let discoverDate = new Date('08-24-2015');
let occurDate = new Date('06-07-2018');
let discover = $filter("date")(discoverDate, "MM/dd/yyyy");
let occur = $filter("date")(occurDate, "MM/dd/yyyy");
console.log(discover);
console.log(occur);
if (discoverDate.getTime() < occurDate.getTime()) {
console.log('Discover less than occur');
} else {
console.log('No');
}
Despite assigning different values to the discover variable, the result is always No.
Did I make a mistake in my comparison?