mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add deadline to list
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskDeadlineService {
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user