UNPKG

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