I'm trying to write a piece of code similar to below in AngularJS:
$scope.isAfterToday= function(inputDate){
if(inputDate > Date.now().toString()){
return true;
} else {
return false;
}
}
However, the problem is that the parameter inputDate comes in the format "2016-10-12T00:00:00" which is different than the format that comes out of the Date.now() function. Is there an easy way to convert between these two formats other than brute force of parsing out the month, day, and year from each and comparing the two?
Thank you for any help!