//#region src/utils/dates.d.ts declare function isWeekend(date: Date): boolean; declare function fromNow(date: Date): string; declare function fromNowDetailed(date: Date): { result: string; /** * May be Infinity if the result will never change. */ secondsUntilChange: number; }; /** * Returns a string representation of the given date in the format expected by the `datetime-local` input type. */ declare function getInputDatetimeLocalString(date: Date): string; type Interval = [number, 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year']; type DayInterval = [number, 'day' | 'week' | 'month' | 'year']; declare function subtractInterval(date: Date, interval: Interval): Date; declare function addInterval(date: Date, interval: Interval): Date; declare const FAR_FUTURE_DATE: Date; declare function getIntervalsElapsed(anchor: Date, to: Date, repeat: DayInterval): number; /** * The UTC millis of the `occurrence`-th (1-based) repeat of `interval` after `anchorMillis`. * * Each boundary is computed from the *original* anchor (never by stepping off the previous, possibly * clamped, boundary) so the anchor's day-of-month is preserved across resets: a Jan 31 anchor yields * Feb 28, Mar 31, Apr 30, ... (matching Stripe's billing-cycle behavior) rather than drifting to * Feb 28, Mar 28, ... . Month/year overflow (e.g. Jan 31 -> Feb) is clamped to the target month's * last day. Day/week are exact multiples (no calendar involved, so no drift possible). * * Everything is done in UTC (unlike `addInterval`, which uses local-time Date accessors) so the * result is deterministic regardless of the server's timezone — this is relied upon by bulldozer * folds, which must be reproducible across machines. * * `occurrence` 0 returns the anchor itself; `getIntervalsElapsed` counts these same boundaries, so * the two are always consistent for a given DayInterval. */ declare function nthDayIntervalMillis(anchorMillis: number, interval: DayInterval, occurrence: number): number; //#endregion export { DayInterval, FAR_FUTURE_DATE, Interval, addInterval, fromNow, fromNowDetailed, getInputDatetimeLocalString, getIntervalsElapsed, isWeekend, nthDayIntervalMillis, subtractInterval }; //# sourceMappingURL=dates.d.ts.map