Can anyone tell me why my date is not get working. Basically when i try to compare date then is is not working in angularJs
var dateObj1 = $filter("date")(Date.now(), 'dd-MMM-yyyy'); // output is "04-May-2016"
var dateObj2 = $scope.employee.Tue; // output is "03-May-2016"
if (dateObj1 < dateObj2) {
return true
} else {
return false;
}
above is working but for case below is not working if i use date as "26-Apr-2016" i get true in return
var dateObj1 = $filter("date")(Date.now(), 'dd-MMM-yyyy'); // output is "04-May-2016"
var dateObj2 = $scope.employee.Tue; // output is "26-Apr-2016"
if (dateObj1 < dateObj2) {
return true
} else {
return false;
}