UNPKG

766 BTypeScriptView Raw
1/**
2 * @name isThisHour
3 * @category Hour Helpers
4 * @summary Is the given date in the same hour as the current date?
5 * @pure false
6 *
7 * @description
8 * Is the given date in the same hour as the current date?
9 *
10 * @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).
11 *
12 * @param date - The date to check
13 *
14 * @returns The date is in this hour
15 *
16 * @example
17 * // If now is 25 September 2014 18:30:15.500,
18 * // is 25 September 2014 18:00:00 in this hour?
19 * const result = isThisHour(new Date(2014, 8, 25, 18))
20 * //=> true
21 */
22export declare function isThisHour<DateType extends Date>(
23 date: DateType | number | string,
24): boolean;