I would like to check if a campaign is currently active or not. The dates deal.Campaign.start and deal.Campaign.end are strings from my backend, now is a date object. How can I cast the strings to date objects in the HTML file?
Ideally I would create the date objects in the controller, but this does not work as I loop over the objects in the HTML file.
controller.js:
$scope.now = new Date();
HTML:
<span ng-repeat="deal in deals">
<span ng-show="deal.Campaign.start < now && deal.Campaign.end > now">
<span>Active</span>
</span>
</span>