In IE8 my dates are not appearing properly. I have tried many implementations but they are not working properly. Here is what I had originally that works in FF, Chrome and IE9.
var date = TranslateDate(new Date(CreatedDate);
where CreatedDate is a c# datetime object.
function TranslateDate(d) {
return GetMonth(d) + '/' + GetDay(d) + '/' + d.getFullYear();
}
function GetMonth(d) {
var month = d.getMonth() + 1;
return (('' + month).length < 2 ? '0' : '') + month;
}
function GetDay(d) {
var day = d.getDate();
return (('' + day).length < 2 ? '0' : '') + day;
}
Any help would be appreciated!
By far the easiest solution was to use moment.js. Make sure you save the file instead of looking it up based on a url for IE 8.