I have a grid that is displaying a date of 1/1/2013 (It was populated from a DateTime object 1/1/2013 5:00 AM in UTC time)
It displays in the grid as 1/1/2013. However when I do the following to get the underlying record for the row and log the columns value to the console it is now incorrect and displays in the console Mon Dec 31 2012 19:00:00 GMT-0500 (Eastern Standard Time)
I use the following calls to get at the record that was used to populate the grid
var grid = patientInfo.data("igGrid");
var records = grid.dataSource.dataView();
var activeRecord = records[index];
What can I do to keep the correct date/time in the grid. I have tried converting all DateTime objects ToUniversalTime and that did not help
Hi,
you can set enableUTCDates to true:
/* type="bool" enables formatting of the dates as UTC. Note that this may be desirable when the dates are coming from a backend, encoded as UTC. Otherwise, if dates are created on the client (in the browser), most probably keeping enableUTCDates to false is the desired behavior */ enableUTCDates: false
(false is the default value)
Hope it helps. Thanks,
Angel
HI ,
i am getting in that format at mvc controller or transaction gt/Date(1509954765000)/
even i have done the enableUTCDates :true
thanks,
Siddharth