Hello,
i am trying to sum up or deduct dates in selected range using jquery datepicker, here is how i am doing it right now but without any luck.
function test(){
var sundayCheck = 0;
var saturdayCheck = 0;
var totalDays = 0;
sundayCheck = new Date($("#onlySunday").datepicker("getDate"));
saturdayCheck = new Date($("#onlySaturday").datepicker("getDate"));
totalDays = saturdayCheck.getDate() - sundayCheck.getDate();
alert(totalDays);
}
thats a piece of code that should make calculation but what it does is just deducts days like,
24.01.10 - 06.02.10 = -18 which is totaly wrong as it should be more days its just does not consider the days and its just using first numbers of dates.
If anyone could help how to make such calculations i would appreciate the most.