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
Hello!
I have exactly the same problem. I would use the first option (override the date constructor only for the IE8 browser) but I can't do it.
Please, may I have a sample for overring the date constructor?
F2O
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 PavlovInfragistics, Inc.
Here is even more info.
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.
schemaGenerated: generateSchema, columnsgenerated: generateColumns,
$("#dataGrid").igGrid({ schemaGenerated: generateSchema, columnsgenerated: generateColumns, dataRendering: gridRendering, autoGenerateColumns: true, defaultColumnWidth: "150px", width: "100%", dataSource: data, dataSourceType: "json", responseDataKey: "data", features: gridFeatures }); function generateSchema(evt, ui) { var nrOfColumns = ui.schema.fields.count(); for (var i = 0; i < nrOfColumns; i++) { var metadata = currentViewInfo.metaDataList[i]; ui.schema.fields[i].type = metadata.ColumnDataType; }}function generateColumns(evt, ui) { var nrOfColumns = ui.owner.options.columns.count(); for (var i = 0; i < nrOfColumns; i++) { var metadata = currentViewInfo.metaDataList[i]; ui.owner.options.columns[i].dataType = metadata.ColumnDataType; }}
$("#dataGrid").igGrid({ schemaGenerated: generateSchema, columnsgenerated: generateColumns, dataRendering: gridRendering, autoGenerateColumns: true, defaultColumnWidth: "150px", width: "100%", dataSource: data, dataSourceType: "json", responseDataKey: "data", features: gridFeatures });
function generateSchema(evt, ui) { var nrOfColumns = ui.schema.fields.count(); for (var i = 0; i < nrOfColumns; i++) { var metadata = currentViewInfo.metaDataList[i]; ui.schema.fields[i].type = metadata.ColumnDataType; }}function generateColumns(evt, ui) { var nrOfColumns = ui.owner.options.columns.count(); for (var i = 0; i < nrOfColumns; i++) { var metadata = currentViewInfo.metaDataList[i]; ui.owner.options.columns[i].dataType = metadata.ColumnDataType; }}
Hi agian,
Here is some more information. I have been working all day now to try and figure this out. Seems like IE8 in general has an issue with Date.parse and dates on the format "yyyy-mm-dd". So I thought I would solve the problem by writing my own parser that overrides Date.parse for IE8 in particular but nothing calls is when I initialize and load the grid so I am back at square 0. Does infragistics override Date.parse? And in that case does it work for IE8? Or is there some other reason to why the date column shows up as NaN-NaN-NaN in IE8 but no other browsers?