/** * Shared timezone-aware date helpers for statistics aggregations. */ /** Milliseconds in a single day. */ export declare const DAY_MS: number; /** Maps a short weekday name (as produced by Intl) to its index (Sun = 0). */ export declare const WEEKDAY: Record; /** Parses a `YYYY-MM-DD` string into `[year, month, day]` numbers. */ export declare const parseYmd: (dateStr: string) => [number, number, number]; /** Builds a zero-padded `YYYY-MM-DD` string from numeric parts. */ export declare const ymdToStr: (y: number, m: number, d: number) => string; /** Parses a `YYYY-MM-DD` string as midnight UTC. */ export declare const toUtcDate: (dateStr: string) => Date; /** Formats a date as a `YYYY-MM-DD` string in UTC. */ export declare const formatDate: (date: Date) => string; /** Adds `days` to a `YYYY-MM-DD` string, returning the resulting `YYYY-MM-DD`. */ export declare const addDaysToDateStr: (dateStr: string, days: number) => string; /** Next civil calendar day (proleptic Gregorian). Avoids DST 24h steps that can stall iteration. */ export declare const incrementYmd: (y: number, m: number, d: number) => [number, number, number]; /** * Formats a date as the calendar day in the given timezone. * `en-CA` yields ISO-8601 `YYYY-MM-DD`, which is lexicographically sortable * (string compare == chronological compare) and matches MongoDB's `%Y-%m-%d`. */ export declare const formatYmdInTz: (date: Date, timezone: string) => string; /** * Returns the calendar day in the given timezone as numeric parts. * Reads parts by `type` (not string order), so `en-US` is fine here. */ export declare const getYmdInTz: (date: Date, timezone: string) => { y: number; m: number; d: number; }; /** Weekday index (Sun = 0) of a date in the given timezone. */ export declare const getWeekdayInTz: (date: Date, timezone: string) => number; /** * Returns the given `YYYY-MM-DD` day at noon UTC — a stable anchor inside the * calendar day, far from midnight so timezone/DST shifts can't cross a date boundary. */ export declare const dateAtNoonUtc: (dateStr: string) => Date; /** * UTC instant at the start of the given `YYYY-MM-DD` calendar day in `timezone`. * Binary-searches the boundary so it stays correct across DST transitions. */ export declare const startOfCalendarDayInTz: (dateStr: string, timezone: string) => Date; /** UTC instant at the last millisecond of the given calendar day in `timezone`. */ export declare const endOfCalendarDayInTz: (dateStr: string, timezone: string) => Date; //# sourceMappingURL=date.utils.d.ts.map