Add files via upload
This commit is contained in:
6
frontend/src/utils/dateHelpers.js
Normal file
6
frontend/src/utils/dateHelpers.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import { format, isBefore, isToday, parseISO } from 'date-fns'
|
||||
|
||||
export const formatDate = (s) => s ? format(parseISO(s), 'MMM d, yyyy') : ''
|
||||
export const formatDateForInput = (s) => s ? s.substring(0, 10) : ''
|
||||
export const isOverdue = (s) => s && isBefore(parseISO(s), new Date()) && !isToday(parseISO(s))
|
||||
export const isDueToday = (s) => s && isToday(parseISO(s))
|
||||
Reference in New Issue
Block a user