mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Fix order
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ObjectService } from './object.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SortService {
|
||||
|
||||
constructor() { }
|
||||
constructor(private ObjectService: ObjectService) { }
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
if(myArray.length > 0){
|
||||
@@ -14,6 +15,7 @@ export class SortService {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayByDate(myArray: any) {
|
||||
console.log(myArray[0].taskStartDate);
|
||||
if(myArray.length > 0){
|
||||
@@ -22,4 +24,15 @@ export class SortService {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
sortDate(array = [], path: string) {
|
||||
|
||||
return array.sort( (a,b)=> {
|
||||
|
||||
return new Date(this.ObjectService.deepFind(b, path)).getTime() -
|
||||
new Date(this.ObjectService.deepFind(a, path)).getTime()
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user