I am reading a date from local storage and then need to compare it to another date but it does not work. I think I need to typecast it but am very rusty with Javascript, please have a look, my code is not much:
// ****** ### IMPORTANT: The below line returns "2011,3,20" ### *******
var da_expiry_date = localStorage['list_expiry_date'];
var today_date = new Date();
var future_date = new Date();
future_date.setFullYear(da_expiry_date+2);
alert (future_date+"\n"+today_date);
if (future_date>today_date) {
alert("1");
}
else {
alert("2");
}
Thanks in advance!