Hi!
I'm having a hard time using the jQuery spreadsheet to give me a date value in javascript.
after a button click I need to get the value of a cell as a date object. However the range.value() returns a number (not epoch or milliseconds.)
//set the value
currentSpreadsheet.activeSheet().range("A1").value(new Date('01/01/2018')) // no problem here
var cellValue = currentSpreadsheet.activeSheet().range("A1").value() // in this case, cellValue returns 43101. I need the date. (01/01/2018 in this case)
How do I convert cellValue to a javascript date?? ... or how do I access the cell so it gives me the date value? I'm not familiar how to convert this number to a Date object.
Cell definition (all of this works fine. I only want to get the value and convert it to date):
{
format: kendo.culture().calendar.patterns.d,
transform : function(val){
if (!val) return '';
return (new Date(val));
}
validation :{
dataType: "date",
showButton: true,
comparerType: "between",
from: 'DATEVALUE("1/1/1900")',
to: 'DATEVALUE("1/1/2100")',
allowNulls: !esRequerido,
type: "reject",
titleTemplate: " bla bla",
messageTemplate: "Bla bla"
}
Any help will be appreciated.
Armando