Hi,
I get a date from a datetime picker with this:
var endDate = new Date();
endDate = $("input[id$='DateTimeControl2Date']").val()
Then I find another date and try to check how many days there are between these two dates but I get the error "Object doesn't support this property or method". What am I doing wrong?
$('.StatusDateTable').each(function() {
var statusDate = new Date();
statusDate = $(this).find(".dates").html();
var statusLight = $(this).find(".StatusLight").attr("src");
statusLight = statusLight.substring(33).slice(0,-9);
if (statusLight == "Blue") {
var oneDay = 1000*60*60*24;
alert(endDate + statusDate);
var date1_ms = endDate.getTime();
var date2_ms = statusDate.getTime();
var dayDifference = Math.abs(Math.round((date1_ms - date2_ms)/oneDay));
alert(dayDifference);
}
});
endDate has the format of 02/09/2010 and statusDate 1/09/2010.
Thanks in advance.