/** * Date comparison predicates and time-stripping helpers. * * All functions operate on **local** calendar days (no UTC conversion), so a * `Date` constructed in the user's timezone compares the way they see it on a * wall calendar. Part of the Svelte-free, server-capable `@urbicon-ui/blocks/date` * layer. */ /** Strip the time component, returning local midnight of the same calendar day. */ export declare function stripTime(date: Date): Date; /** Check whether two dates fall on the same calendar day (ignoring time). */ export declare function isSameDay(a: Date, b: Date): boolean; /** * Check whether a date is a weekend day (Saturday or Sunday). * * Weekend is defined as Saturday + Sunday regardless of `weekStartsOn` — the * day a week is laid out from does not change which days are non-working. A * locale-specific weekend (e.g. Friday + Saturday) is intentionally out of * scope; add an explicit option if a consumer ever needs it. */ export declare function isWeekend(date: Date): boolean; /** Check whether a date falls within a range (inclusive on both ends, order-independent). */ export declare function isInRange(date: Date, start: Date, end: Date): boolean; /** * Clamp a date into optional `[minDate, maxDate]` day boundaries — the * day-level sibling of `clampMonth`. Comparison is on calendar days (time is * stripped from both sides), so a date already inside the range is returned * unchanged (keeping its own time-of-day) while an out-of-range date snaps to * local midnight of the nearest boundary. Either bound may be omitted. */ export declare function clampDate(date: Date, minDate?: Date, maxDate?: Date): Date; /** Check whether a date belongs to the given month and year. */ export declare function isInMonth(date: Date, month: number, year: number): boolean; /** * DST-safe count of whole calendar days from `a` to `b`. * Positive when `b` is after `a`. Computed via UTC midnight to avoid * daylight-saving hour shifts skewing the division. */ export declare function daysBetween(a: Date, b: Date): number;