I have the following code on a web page:
var date = new Date(row.EventDate.replace('T', ' ')); // 'T' comes from sql server
var month = date.getMonth() + 1;
var day = date.getDate();
var year = date.getFullYear();
var hours = date.getHours();
var minutes = date.getMinutes();
return '<span>' +
(month > 9 ? month : '0' + month) +
'/' +
(day > 9 ? day : '0' + day) +
'/' +
year +
' ' +
(hours > 9 ? hours : '0' + hours) +
':' +
(minutes > 9 ? minutes : '0' + minutes) +
'</span>';
Chome displays as 02/27/2017 13:30
as expected, but IE shows NaN/NaN/NaN NaN:NaN
I have read several posts about issues setting a date field having issues like this, but I am setting a text string.
Where am I having the disconnect as to why IE is complaining about something not being a number?