Wondering if anyone has a solution for checking if a weekend exist between two dates and its range.
var date1 = \'Apr 10, 2014\';
var date2 = \'Apr 14, 2014\
I guess this is the one what @MattBurland sugested for doing it without a loop
function isWeekend(start,end){
start = new Date(start);
if (start.getDay() == 0 || start.getDay() == 6) return true;
end = new Date(end);
var day_diff = (end - start) / (1000 * 60 * 60 * 24);
var end_day = start.getDay() + day_diff;
if (end_day > 5) return true;
return false;
}
FIDDLE