UNPKG

2.42 kBTypeScriptView Raw
1import { isSameDay } from "date-fns";
2import { type DateRange } from "./dateRange";
3export { isSameDay };
4export declare function clone(d: Date): Date;
5export declare function isDateValid(date: Date | false | null): date is Date;
6export declare function isEqual(date1: Date, date2: Date): boolean;
7export declare function areRangesEqual(dateRange1: DateRange, dateRange2: DateRange): boolean;
8export declare function isSameMonth(date1: Date, date2: Date): boolean;
9export declare function isSameTime(d1: Date | null, d2: Date | null): boolean;
10export declare function isDayInRange(date: Date | null, dateRange: DateRange, exclusive?: boolean): boolean;
11export declare function isDayRangeInRange(innerRange: DateRange, outerRange: DateRange): boolean;
12export declare function isMonthInRange(date: Date, dateRange: DateRange): boolean;
13export declare const isTimeEqualOrGreaterThan: (time: Date, timeToCompare: Date) => boolean;
14export declare const isTimeEqualOrSmallerThan: (time: Date, timeToCompare: Date) => boolean;
15export declare function isTimeInRange(date: Date, minDate: Date, maxDate: Date): boolean;
16export declare function getTimeInRange(time: Date, minTime: Date, maxTime: Date): Date;
17/**
18 * Returns true if the time part of `date` is later than or equal to the time
19 * part of `dateToCompare`. The day, month, and year parts will not be compared.
20 */
21export declare function isTimeSameOrAfter(date: Date, dateToCompare: Date): boolean;
22/**
23 * @returns a Date at the exact time-wise midpoint between startDate and endDate
24 */
25export declare function getDateBetween(dateRange: DateRange): Date;
26export declare function getDateTime(date: Date | null, time?: Date | null): Date;
27export declare function getDateOnlyWithTime(date: Date): Date;
28export declare function getDatePreviousMonth(date: Date): Date;
29export declare function getDateNextMonth(date: Date): Date;
30export declare function convert24HourMeridiem(hour: number, toPm: boolean): number;
31export declare function getIsPmFrom24Hour(hour: number): boolean;
32export declare function get12HourFrom24Hour(hour: number): number;
33export declare function get24HourFrom12Hour(hour: number, isPm: boolean): number;
34export declare function isToday(date: Date): boolean;
35export declare function hasMonthChanged(prevDate: Date | null, nextDate: Date | null): boolean;
36export declare function hasTimeChanged(prevDate: Date | null, nextDate: Date | null): boolean;