I have a function that converts a date to YYYY-MM-DD from DD/MM/YYYY.
This works in all browsers apart from IE8, for some reason, when creating a new Date object, it is returning NaN.
Basic implementation of the code http://jsfiddle.net/bX83c/1/
var compareDate = function(value){
var dateFragements = value.split('/');
if (dateFragements.length == 3) {
var currentDate = new Date();
currentDate.setHours(0, 0, 0, 0);
var startDate = new Date(dateFragements[2] + '-' + dateFragements[1] + '-' + dateFragements[0]);
if (startDate >= currentDate) {
return true;
} else {
return false;
}
}
}
alert(compareDate('17/09/2013'));