Posted 28 December 2017, 7:03 am EST
Hello. I created a command that overrides the default editCell command because we needed to do some auditing over the changes and other stuff. I want to be able to detect when the value entered is a date. For example, if I enter ‘12/10/1900’ in a cell, the newValue parameter is treated as string when set to a cell instead of date (this means that it will be left aligned in the cell). Does SpreadJS provides a helper or something to detect this? Because when using the editCell from SpreadJS the value entered looks to be converted to date somehow.
register(commandManager) {
commandManager.register('editCell', {
canUndo: true,
execute: (context, options, isUndo) => {
if (isUndo) {
this.undo(options);
} else {
this.do(context, options);
}
},
});
}
do(context, options) {
...
options.sheet.setValue(options.row, options.col, options.newValue);
...
}