Comparing dates with using CoffeeScript and Angular

Comparing dates with using CoffeeScript and Angular

If you need to compare dates for expiring etc. you can follow these steps

first you should add date objects to your angular controller

Note:

$scope.currentDate = new Date().getTime() $scope.expiringDateFormatted = (checkDate) -> new Date(checkDate).getTime()

then you can change your html page like that

Note:

Expired

Not Expired

Date Examples

Note:

item.expiringDate = 2016-05-09 currentDate = ā€˜2016-08-09T04:00:00.000Zā€™