mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
22 lines
680 B
TypeScript
22 lines
680 B
TypeScript
|
|
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);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|