Git pull made- changes made on list order

This commit is contained in:
Eudes Inácio
2021-10-19 08:25:03 +01:00
20 changed files with 228 additions and 171 deletions
-1
View File
@@ -108,7 +108,6 @@ export class AuthService {
localStorage.setItem('Meteor.userId',responseChat['data'].userId);
this.cookieService.set('rc_token', responseChat['data'].authToken);
this.cookieService.set('rc_uid', responseChat['data'].userId);
alert(this.cookieService.get('rc_uid'));
this.storageService.store(AuthConnstants.AUTH, responseChat);
return true;
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SortService } from './sort.service';
describe('SortService', () => {
let service: SortService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SortService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -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);
});
}
}