ts-time-utils
Version:
A comprehensive TypeScript utility library for time, dates, durations, and calendar operations with full tree-shaking support
44 lines • 1.94 kB
TypeScript
/**
* Predefined date range helpers for common time periods
*/
import type { DateRange } from './types.js';
export declare function today(now?: Date): DateRange;
export declare function yesterday(now?: Date): DateRange;
export declare function tomorrow(now?: Date): DateRange;
export declare function lastNDays(n: number, now?: Date): DateRange;
export declare function nextNDays(n: number, now?: Date): DateRange;
export declare function thisWeek(now?: Date): DateRange;
export declare function lastWeek(now?: Date): DateRange;
export declare function nextWeek(now?: Date): DateRange;
export declare function thisMonth(now?: Date): DateRange;
export declare function lastMonth(now?: Date): DateRange;
export declare function nextMonth(now?: Date): DateRange;
export declare function thisYear(now?: Date): DateRange;
export declare function lastYear(now?: Date): DateRange;
export declare function nextYear(now?: Date): DateRange;
export declare function rollingWindowDays(days: number, now?: Date): DateRange;
export declare function quarterRange(now?: Date): DateRange;
export declare function lastQuarter(now?: Date): DateRange;
export declare function nextQuarter(now?: Date): DateRange;
/** Map of preset functions for dynamic access */
export declare const RANGE_PRESETS: {
today: typeof today;
yesterday: typeof yesterday;
tomorrow: typeof tomorrow;
last7Days: (now?: Date) => DateRange;
last30Days: (now?: Date) => DateRange;
next7Days: (now?: Date) => DateRange;
thisWeek: typeof thisWeek;
lastWeek: typeof lastWeek;
nextWeek: typeof nextWeek;
thisMonth: typeof thisMonth;
lastMonth: typeof lastMonth;
nextMonth: typeof nextMonth;
thisYear: typeof thisYear;
lastYear: typeof lastYear;
nextYear: typeof nextYear;
quarter: typeof quarterRange;
lastQuarter: typeof lastQuarter;
nextQuarter: typeof nextQuarter;
};
//# sourceMappingURL=rangePresets.d.ts.map