What\'s a good method to, given two Date objects, compare the difference between their time portion only, completely ignoring Year, Month and Day?
It\'s quite the op
Dont know how good practiced or efficent is this one but i've written a simple function using the Date object that serves my purposes. It returns a true or false is the first date value bigger than the second. The inputs d1 && d2 are Date objects.
function CompareTimes(d1, d2) {
if (d1.getHours() < d2.getHours()) {
return false;
}
if (d1.getHours() > d2.getHours()) {
return true;
} else {
return (d1.getMinutes() > d2.getMinutes());
}
};