mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
order by date
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SortService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function (a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
sortArrayByDate(myArray: any) {
|
||||
console.log(myArray[0].taskStartDate);
|
||||
return myArray.sort(function (a, b) {
|
||||
return (new Date(a.workflowInstanceDataFields.StartDate) < new Date(b.workflowInstanceDataFields.StartDate)) ? -1 : ((new Date(a.workflowInstanceDataFields.StartDate) > new Date(b.workflowInstanceDataFields.StartDate)) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user