Unplanned
Last Updated: 09 Aug 2021 11:01 by ADMIN
Stephen
Created on: 09 Aug 2021 01:36
Category: Spreadsheet
Type: Bug Report
0
Null Date on a spreadsheet is stored as incorrect value

Hi, I'm using the spreadsheet control and i'm having an issue with date columns.

When I enter a valid date, it works fine.

but when I enter an empty date (clicking delete on date column, or emptying out the contents)

the date gets stored as "new Date(0,0,-1)" ["Sat Dec 30 1899 00:00:00 GMT+1130 (New Zealand Daylight Time)" in my local time]

obviously, this is incorrect, and it should store the value as NULL.

it happens regardless of whether the schema/model has nullable=true.

If I manually modify the dataItem via JS, it stores it correctly as null. 

I have a dojo demo set up which replicates the issue.

https://dojo.telerik.com/oFowivUN

 

Steps:

  1. select the ItemDate column of the first row in the spreadsheet
  2. type in a valid date (e.g. 1/1/2020)
  3. Click View ItemDate button (It should show the correct date)
  4. Select the ItemDate column and empty it out (e.g. click delete)
  5. Click View ItemDate button. (it should now show the incorrect date!)

Doing some investigation into the kendo code, it seems to be caused by the serialToDate method of the spreadsheet.

Thanks

1 comment
ADMIN
Veselin Tsvetanov
Posted on: 09 Aug 2021 11:01

Hello Stephen,

The observed should be considered a bug in the Sheet DataSource functionality. That is why I have converted the current thread to a bug report in our public Feedback portal:

https://feedback.telerik.com/kendo-jquery-ui/1530938-null-date-on-a-spreadsheet-is-stored-as-incorrect-value

Apart from that, I have also created a GitHub issue on the same in our public repo:

https://github.com/telerik/kendo-ui-core/issues/6516

Keep tracking the above as they will be updated as soon as we start working on the issue in question.

As a small token of gratitude for reporting this bug, I have updated your Telerik points.

Regards,
Veselin Tsvetanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.