Working through a list of dates (jobs.submitted):
<div ng-controller="DashboardController as dashboard">
<div ng-repeat="job in dashboard.jobs | filter: {status: 'started'}" class="row">
<div class="col-xs-3">{{job.submitted}}</div>
</div>
My goal now is to calculate a duration:
(new Date(job.submitted)) - (new Date(job.completed))
When I try to directly input this into the expression, I encounter a syntax error (possibly due to AngularJS not recognizing the Date object).
If I attempt to place it within a function, specifically one in the controller, the evaluation never occurs:
{{dashboard.getDuration(job)}}
It simply shows up as blank.
What would be the most effective approach to handle this situation?