This commit is contained in:
Eudes Inácio
2021-11-24 14:53:53 +01:00
47 changed files with 358 additions and 221 deletions
+5 -7
View File
@@ -160,14 +160,12 @@ export class ListBoxService {
}
push(event: any, selectedDate: Date) {
console.log(new Date(event.start).getDate(), selectedDate.getDate(), new Date(event.start).getDate() >= selectedDate.getDate())
push(event: any, selectedDate: Date) {
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
new Date(event.start).getDate() >= selectedDate.getDate()
}
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
new Date(event.start).getDate() >= selectedDate.getDate()
}
encapsulation(eventsList:EventListStore[], profile): CustomCalendarEvent[] {
-1
View File
@@ -7,7 +7,6 @@ export class DateService {
constructor() { }
deferenceBetweenDays(start: any, end: any) {
const diffTime = Math.abs(end - start);
return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
+1 -2
View File
@@ -240,7 +240,6 @@ export class FileService {
//this.capturedImage = this.capturedImage;
}
@@ -250,7 +249,7 @@ export class FileService {
quality: 50,
// allowEditing: true,
resultType: CameraResultType.Uri,
source: CameraSource.Photos
source: CameraSource.Camera
});
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ObjectService } from './object.service';
describe('ObjectService', () => {
let service: ObjectService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ObjectService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ObjectService {
constructor() { }
deepFind(obj, path) {
var paths = path.split('.')
, current = obj
, i;
for (i = 0; i < paths.length; ++i) {
if (current[paths[i]] == undefined) {
return undefined;
} else {
current = current[paths[i]];
}
}
return current;
}
}
+14 -1
View File
@@ -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()
})
}
}
+1 -2
View File
@@ -24,8 +24,7 @@ export class WebNotificationsService {
private animationController: AnimationController,
private platform: Platform,
private router: Router,
private toastService: ToastService,
private zone: NgZone) { }
private toastService: ToastService) { }
webconnection() {