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
Hello Donald,
Please let me know if you need any further assistance regarding this matter.
Unfortunately that did not solve my problem..
Hello Ddally,
I have heard back from the development team that Javascript Date objects are always created in the client's timezone, the Grid uses a formatter function to display them in UTC. So you can use the same function to get a string representing the Date in UTC
$.ig.formatter($("#grid").data("igGrid").dataSource.dataView()[0].PatientDateOfBirth, "date", "dateTime", true, true);
I you use MVC databinding logic the server will send offsets for each DateTime object in the data source. These are present in the metadata property of the dataSource.
$("#grid").data("igGrid").dataSource._metadata
Please let me know if you have any further questions regarding this matter.
It seems that the grid should do this automatically. If I put a date into the grid and then ask the grid for the record I Expect the record to be accurate
It also does not work
Nevermind, it looks like the formatter will spit out a valid date
It does spit out a date, it just spits out an invalid formatted date according the the javascript deserializer
I have opened a support request(CAS-110970-B0L6H5) for this forum post so we may research this behavior further. Please use the following link to log onto your account at Infragistics.Com:
https://es.infragistics.com/my-account/support-activity
Once you are logged onto your account, go to My Support Activity to view the progress of this support request. An update will be sent to you in the support request with any new information we find.
Please let me know if you have any questions.
Looks like for null dates it is adding