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
460
igGrid date column becomes NaN-NaN-NaN in IE8
posted

Hi,

Our date columns shows NaN-NaN-NaN for all rows in IE8 but the correct format in FF and IE11.

The Json sent to the grid is on the yyyy-MM-dd format and the column is of 'date' type and has its scheme and options.column data type set to 'date'.

 

Any help would be much appreciated!

 

Best Regards

Fredrik

 

 

 

 

 

Parents Reply
  • 23953
    Verified Answer
    Offline posted in reply to Fredrik Klevmarken

    Hello Fredrik,

    This is an issue of IE 8. See the Date and Time Strings (JavaScript) article on MSDN (search for: "ISO Date Format is not supported in Internet Explorer 8 standards mode and Quirks mode.").

    Fredrik Klevmarken said:
     Does infragistics override Date.parse?

    No. We are creating dates from strings with new Date().

    Fredrik Klevmarken said:
    If I comment the following two lines in the code below then the date column renders correctly but the date filter function does not. If I have the two lines uncommented then the date column does not render correctly but gets NaN-NaN-NaN but the date filter is correctly set.

    That's because the data is treated as a string type.

    We deal with this problem by using the Microsoft approach in their JSON serializer (which is now depricated in favor of Newtonsoft.Json) by serializing the dates in the following format: "\/Date(836427600000)\/".

    What are your options?

    1.You can override the date constructor only for the IE 8 browser.

    2.Serialize your date columns as a number representing the milliseconds since 1 January 1970 00:00:00 UTC (Unix Epoch)

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc. 

Children