utils.ts

src/components/form/utils.ts
import { DateTime } from 'luxon'
// ============================================================================
// Form Utilities & Constants
// ============================================================================
// Default timezone (can be overridden by component props)
export const DEFAULT_TIMEZONE = 'America/New_York'
// Get current date/time in a specific timezone
export function getNow(timezone: string = DEFAULT_TIMEZONE) {
return DateTime.now().setZone(timezone)
}
// Get today's date (start of day) in a specific timezone
export function getToday(timezone: string = DEFAULT_TIMEZONE) {
return getNow(timezone).startOf('day')
}
// Check if a date is in the past (compared to timezone's today)

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC