mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
centralize service
This commit is contained in:
@@ -18,6 +18,9 @@ export class EventoaprovacaoStoreService {
|
||||
private _counts : {[key: string]: number} = {}
|
||||
private _countsAll = 0
|
||||
|
||||
|
||||
newList = []
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyNameAll = (SHA1("EventoaprovacaoStoreService"+"all")).toString()
|
||||
@@ -96,9 +99,25 @@ export class EventoaprovacaoStoreService {
|
||||
|
||||
this._countsAll = allList.length
|
||||
this._concatList = allList
|
||||
|
||||
|
||||
this.newList = this._concatList.filter((e) =>{
|
||||
return this.lessthen24Hours(e.TaskStartDate || e.taskStartDate)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
lessthen24Hours(isoDateString:string) {
|
||||
const creationDate = new Date(isoDateString)
|
||||
const creationDatePlus24h = new Date(creationDate)
|
||||
creationDatePlus24h.setHours((creationDate.getHours() + 24))
|
||||
const currentDate = new Date()
|
||||
|
||||
return creationDatePlus24h.getTime() > currentDate.getTime()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export const EventoAprovacaoStore = new EventoaprovacaoStoreService()
|
||||
|
||||
Reference in New Issue
Block a user