mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
61 lines
2.7 KiB
TypeScript
61 lines
2.7 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { momentG } from 'src/plugin/momentG';
|
|
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
|
|
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
|
|
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
|
|
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
|
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
|
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
|
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
|
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
|
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
|
import { TotalDocumentStore } from 'src/app/store/total-document.service';
|
|
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class TaskDeadlineService {
|
|
|
|
AllProcess = []
|
|
expedientegbstore = ExpedienteGdStore;
|
|
pendentesstore = PendentesStore;
|
|
despachoStore = DespachoStore;
|
|
eventoaprovacaostore = EventoAprovacaoStore;
|
|
pedidosstore = PedidosStore;
|
|
despachoprstore = DespachosprStore;
|
|
totalDocumentStore = TotalDocumentStore
|
|
deplomasStore = DeplomasStore
|
|
|
|
|
|
constructor() { }
|
|
|
|
date(isoDateString:string) {
|
|
return momentG(new Date(), 'dd MMMM yyyy') == momentG(new Date(isoDateString), 'dd MMMM yyyy')
|
|
}
|
|
|
|
lessthen24Hours(isoDateString:string) {
|
|
const creationDate = new Date(isoDateString)
|
|
const creationDatePlus24h = new Date(creationDate)
|
|
creationDatePlus24h.setHours((creationDate.getHours() + 24))
|
|
|
|
return creationDatePlus24h.getTime() > creationDate.getTime()
|
|
}
|
|
|
|
|
|
updateAllProcess() {
|
|
this.AllProcess = this.sortArrayISODate(this.despachoprstore.list.concat(this.deplomasStore.diplomasAssinadoList as any).concat(this.deplomasStore.diplomasParaAssinarList as any).concat(this.deplomasStore.DiplomaGerarList as any).concat(this.deplomasStore.diplomasReviewList)
|
|
.concat(this.eventoaprovacaostore.contactList as any).concat(this.expedientegbstore.list as any).concat(this.despachoStore.list as any).concat(this.pedidosstore.listparecer as any).concat(this.pedidosstore.listdeferimento as any)
|
|
.concat(this.pendentesstore.list as any)).reverse()
|
|
}
|
|
|
|
sortArrayISODate(myArray: any): any[] {
|
|
// return myArray.sort(function (a, b) {
|
|
// return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
|
// });
|
|
|
|
return myArray.sort((a,b) => Date.parse(b.CreateDate || b.taskStartDate) - Date.parse(a.CreateDate || a.taskStartDate))
|
|
}
|
|
|
|
}
|