Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Problem with igGridUpdating with date column
posted

Hey there!

We have problems with igGrid updating when there are columns of type date.
We are setting up the grid using the MVC wrapper and the Updating feature is enabled with EditMode=GridEditMode.Row. The editor type of the date column is set to ColumnEditorType.DatePicker.

We manually submit the changes by serializing the transactions to string with the function "transactionsAsString" and send them to the server. However depending on whether the grid has some data or is initially empty - the date is sent to the server with different time component:

When we load a grid with some records in it and we update a row setting the date to 1991/07/18, when I inspect the grid transactions the date is "Thu Jul 18 1991 03:00:00 GMT+0300 (Eastern European Summer Time)". Thus the serialized date sent to the server as part of the transaction is "1991-07-18T00:00:00.000Z"

When however the grid has no data and we add a new row picking the same date, then the date in the transactions object is Thu Jul 18 1991 00:00:00 GMT+0300 (Eastern European Summer Time) and what is sent to the server is 1991-07-17T21:00:00.000Z.

With older versions of IgniteUI (16.2) the described scenario worked without any problems with dates.

I have attached a sample project demonstrating the problem.

What causes this behaviour and how should we set up the grid and process the transactions (client and server-side) so that dates will always be sent with the same time component (either UTC or local, but not mixing them up)?

igGrid_DateTime_Submit.zip

Parents
  • 0
    Offline posted

    Hello Veselina,

    Thank you for the provided sample. I am currently investigating the behavior of the grid and the date column. I will come back to you with an update as soon as possible.

    In the meanwhile if you have additional questions feel free to ask them.

  • 200
    Offline posted in reply to Martin Kamenov

    Hello Veselina,

    The issue is represent because the DateDisplayType option of the columns wasn’t set. In the first grid the first date adds timezone property to the grid's data column and uses local timezone.

    In order to make the two grid’s timezones equal set both grid configurations the DateDisplayType to DateDisplayType.UTC or to DateDisplayType.Local.

    column.For(x => x.StartDate).HeaderText("StartDate").DataType("date").DateDisplayType(DateDisplayType.UTC);

    In case you have additional questions don’t hesitate to ask them.

Reply Children