Unplanned
Last Updated: 27 Dec 2019 08:09 by ADMIN
Naveen
Created on: 04 Dec 2019 08:45
Category: Kendo UI for jQuery
Type: Feature Request
5
Add methods in Kendo UI that convert to and form Excel date number from and to locale date & UTC date.
Add methods in Kendo UI that convert to and form Excel date number from and to locale date & UTC date.
4 comments
ADMIN
Alex Hajigeorgieva
Posted on: 27 Dec 2019 08:09

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Naveen
Posted on: 26 Dec 2019 11:18

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.

ADMIN
Alex Hajigeorgieva
Posted on: 26 Dec 2019 10:18

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Shafeeq
Posted on: 24 Dec 2019 10:44
Please implement it soon