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
1710
Problem with Dates in Grid
posted

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

Parents
  • 24671
    Suggested Answer
    posted

    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

Reply Children
No Data