I have a aurelia slickgrid table with start date and end date and it is fine. Backend api response is in odata format. Now i want to make a new column called Status and status is calculated as :
<td class="col-xs-4 col-md-2">
<div>
<div if.bind="doesLicenseActivate(lic)">
Activates on ${lic.DateStart}
</div>
<div if.bind="didLicenseEnd(lic)">
Ended on ${lic.DateEnd}
</div>
<div if.bind="isLicenseCurrentlyActive(lic)">
Current License
</div>
<div if.bind="lic.IsCanceled">
Cancelled on ${lic.DateEnd}
</div>
</div>
Basically, those fucntions above such as doesLicenseActivate are bunch of Moment.js function doing some date caclulations. My column looks like:
/* Define grid Options and Columns */
private defineMembershipGrid() {
return this.columnDefinitionsMembershipHistory = [
{ id: "DateStart", name: "Start Date", field: "DateStart", formatter: Formatters.dateEuro, sortable: true, filterable: true, minWidth: 100, },
{ id: "DateEnd", name: "End Date", field: "DateEnd", formatter: Formatters.dateEuro, sortable: true, filterable: true, minWidth: 100, },
{ id: "Duration", name: "Duration", field: "Duration", formatter: this.DurationFormatter, sortable: true, filterable: true, minWidth: 100, },
// make a status column here
];
}
And this is what i want to do, basically make a new Status column and it uses the values from first two columns (start and end date)