Hello,
We are attempting up update from version 16.2 to 17.1. We are using a row edit dialog to edit existing DateTime data and the date is changing on submit.
The date we are sending on the server is 04/01/2013 at midnight. At first, we tried updating the row without changing any data. It appeared the date was changing, but we found that EnableUTCDates was set to TRUE for the DateTimeEditor, but was not set for the Grid. So we set this option to TRUE for both the grid and editor. This fixed the initial issue. Or second test involved updating the date itself. We changed the date from 4/1/2013 to 4/2/2013 and then back to 4/1/2013 using the datepicker. When we do this, the date is changing when it gets to the server.
In 16.2, the data looked like this when it got to the server:
{{"Id": 59,"StartDate": "2013-04-01T00:00:00Z"}}
In 17.1, we are seeing the following date:
{{"Id": 59,"StartDate": "2013-04-01T16:00:00Z"}}
What are the recommended settings for preventing a date from changing on submit to the server? We would expect this to work exactly the same as it did in 16.2 as we didn't have any problems with the dates in that version.
Thanks,
Paul
Hello Paul,
EnableUTCDates behavior changed between 16.2 and 17.1. Here are some links that explain the new functionality and how to migrate the option.
https://www.igniteui.com/help/breaking-changes-2017-volume-1
https://www.igniteui.com/help/migrating-enableutcdates-option-in-17-1
https://www.igniteui.com/help/using-igniteui-controls-in-different-time-zones
If you have further questions, a case has been created for you and you can reply to this post to update it.
Elizabeth AlbertLocalization Engineer
Hi Elizabeth,
Thanks for the links, they were helpful. I'm still having a tough time with this though. I can't seem to get the results that I am looking for. To make things easier, I tested this with my server and client in the same timezone, UTC-05:00. The date from my server is 4/1/2013 12:00:00 AM. I'm using C# MVC to generate the grid control and then I'm using JsonConvert.DeserializeObject<List<Transaction<T>>>(a_Controller.HttpContext.Request.Form["ig_transactions"]) to deserialize the data on the server side, so I'm not sure if that has something to do with the issue I am seeing. Also, I'm using a row edit dialog to update the data and a ColumnEditorType.DatePicker.
I tried using the DateDisplayType.UTC as mentioned in the article and below are my results (I'm showing this for my sanity as well). Previously, I tested this without using the DateDisplayType setting and the results from those tests are not included, but that didn't work either (I can provide those tests if needed though). Below, where it says "CHANGE RESULT", this is the resulting date that is passed back to the server when I used the DatePicker to change the date to 4/2/2013 and then back to 4/1/2013. For the "NO CHANGE RESULT", I didn't make any changes to the date and just hit "Done" to submit my changes.
gridModel.EnableUTCDates = true;updatingSetting.DateEditorOptions.EnableUTCDates = true;column.DateDisplayType = DateDisplayType.UTCCHANGE RESULT: 4/1/2013 4:00:00 PMNO CHANGE RESULT: 4/1/2013 12:00:00 AM
gridModel.EnableUTCDates = false;updatingSetting.DateEditorOptions.EnableUTCDates = true;column.DateDisplayType = DateDisplayType.UTC;CHANGE RESULT: 4/1/2013 4:00:00 PMNO CHANGE RESULT: 3/31/2013 8:00:00 PM
gridModel.EnableUTCDates = false;updatingSetting.DateEditorOptions.EnableUTCDates = false;column.DateDisplayType = DateDisplayType.UTC;CHANGE RESULT: 4/1/2013 12:00:00 PMNO CHANGE RESULT: 3/31/2013 8:00:00 PM
gridModel.EnableUTCDates = true;updatingSetting.DateEditorOptions.EnableUTCDates = false;column.DateDisplayType = DateDisplayType.UTC;CHANGE RESULT: 4/1/2013 8:00:00 PMNO CHANGE RESULT: 4/1/2013 12:00:00 AM
So I can't seem to get a 4/1/2013 12:00:00 AM date back to the server. Is there something I am missing?