UNPKG

831 BTypeScriptView Raw
1/**
2 * @name isAfter
3 * @category Common Helpers
4 * @summary Is the first date after the second one?
5 *
6 * @description
7 * Is the first date after the second one?
8 *
9 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
10 *
11 * @param date - The date that should be after the other one to return true
12 * @param dateToCompare - The date to compare with
13 *
14 * @returns The first date is after the second date
15 *
16 * @example
17 * // Is 10 July 1989 after 11 February 1987?
18 * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
19 * //=> true
20 */
21export declare function isAfter<DateType extends Date>(
22 date: DateType | number | string,
23 dateToCompare: DateType | number | string,
24): boolean;