I'm looking to create a function in AngularJS that checks if a given date is after today:
$scope.isAfterToday= function(inputDate){
if(inputDate > Date.now().toString()){
return true;
} else {
return false;
}
}
The issue I am facing is that the inputDate parameter comes in the format "2016-10-12T00:00:00" which is different from the output of the Date.now() function. Is there a simple way to convert between these formats without manually extracting the month, day, and year from each for comparison?
Appreciate any guidance on this matter!