web/src/lib/date.js

8 lines
174 B
JavaScript
Raw Normal View History

2024-05-18 17:11:05 +02:00
import { isPast } from 'date-fns';
export function isFutureDate (dt) {
if (dt.match(/^\d{4}-\d{2}-\d{2}$/) && isPast(new Date(dt))) {
return false
}
return true
}