Hello, Naveen,
Thank you for taking the time to clarify the use case.
We have now accepted your suggestion. Once it collects more votes, it can be considered for future implementation.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Hi Alex,
As of now I am importing an xlsx file in Spreadsheet Control integrated in my application. Now on, some user actions I need to fetch value of predefined date time formatted cells. Spreadsheet range.value returns it as some numeric value instead of DateTime JS object, as shown in below code
let cellValue = range.value(); //range here is reference to Date formatted cell
Here cellValue is like 43536.479166667, so I am using this function Excel Date to JS Date(suggested by Dimitar) to convert this numeric value to JS Date Object.
So my request was to provide following standard functions to deal with these conversions. Instead of developer finding & writing code to convert Excel date to JS date, why not Kendo can add these functions in spreadsheet JS library itself.
1. ExcelDateToJSDate //e.g. 43536.479166667 to 3/12/19 11:30
2. JSDateToExcelDate //e.g. 3/12/19 11:30 to 43536.479166667
3. ExcelDateToUTCJSDate
4. UTCJSDateToExcelDate
Please let me know in case you need more information on it.
Hello,
To represent the date cell value as Excel number, you can utilize the number formats:
https://support.office.com/en-us/article/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68
To configure it, use the sheet.rows.cells.format option, for example:
{ value: new Date(), format: "???" }
Here is a runnable example demonstrating that:
https://dojo.telerik.com/@bubblemaster/aHimAdiR/3
Once the file is exported, you can verify that it is correct by clicking on the cell and changing the format of the cell in Excel:
In case you had something else in mind, please elaborate what is the desired outcome.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik