add labels

This commit is contained in:
Peter Maquiran
2023-04-13 12:51:38 +01:00
parent 0660b44542
commit f8614029af
64 changed files with 1113 additions and 208 deletions
+41 -1
View File
@@ -22,6 +22,13 @@ export class DeplomasService {
private _diplomasGerarListCount = 0;
private _diplomasListCount = 0;
diplomasAssinadoListNewCount = []
diplomasReviewListNewCount = []
diplomasGerarListNewCount = []
diplomasParaAssinarNewCount = []
constructor() {
this.keyNameDiplomasAssinado = (SHA1("DeplomasService"+"diplomasAssinado")).toString()
this.keyNameDiplomasReview = (SHA1("DeplomasService"+"diplomasReview")).toString()
@@ -150,6 +157,7 @@ export class DeplomasService {
count: this._diplomasReviewCount,
})
}, 10)
this.updateNewCount()
}
private saveDiplomasAssinadoList() {
@@ -159,7 +167,8 @@ export class DeplomasService {
list: this._diplomasAssinadoList,
count: this._diplomasAssinadoListCount,
})
}, 10)
}, 10)
this.updateNewCount()
}
private saveDiplomasParaAssinar () {
@@ -169,6 +178,7 @@ export class DeplomasService {
count: this._diplomasListCount,
})
}, 10)
this.updateNewCount()
}
private savetDiplomaGerar() {
@@ -178,8 +188,38 @@ export class DeplomasService {
count: this._diplomasGerarListCount,
})
}, 10)
this.updateNewCount()
}
updateNewCount() {
this.diplomasAssinadoListNewCount = this._diplomasAssinadoList.filter((e) =>{
return this.lessthen24Hours(e.TaskStartDate)
})
this.diplomasReviewListNewCount = this._diplomasReviewList.filter((e) =>{
return this.lessthen24Hours(e.TaskStartDate)
})
this.diplomasGerarListNewCount = this._diplomasGerarList.filter((e) =>{
return this.lessthen24Hours(e.TaskStartDate)
})
this.diplomasParaAssinarNewCount = this._diplomasParaAssinar.filter((e) =>{
return this.lessthen24Hours(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 let DeplomasStore = new DeplomasService()