mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add deadline to list
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
deadlineIsToday(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))
|
||||
const currentDate = new Date()
|
||||
|
||||
return creationDatePlus24h.getTime() > currentDate.getTime()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user