Files
wedding-website/lib/rsvp-deadline.ts
T
Raul Lugo 4ced446c9c
Build & Deployment / Build & Deploy (push) Failing after 5s
initial commit
2026-08-10 17:55:26 +02:00

15 lines
329 B
TypeScript

export function getRsvpDeadline() {
const value = process.env.RSVP_DEADLINE
if (!value) return null
return value
}
export function isRsvpClosed(now = new Date()) {
const deadline = getRsvpDeadline()
if (!deadline) return false
const deadlineEnd = new Date(`${deadline}T23:59:59.999Z`)
return now > deadlineEnd
}