UNPKG

803 BTypeScriptView Raw
1import type { ContextOptions, DateArg } from "./types.js";
2/**
3 * The {@link isThisHour} function options.
4 */
5export interface IsThisHourOptions extends ContextOptions<Date> {}
6/**
7 * @name isThisHour
8 * @category Hour Helpers
9 * @summary Is the given date in the same hour as the current date?
10 * @pure false
11 *
12 * @description
13 * Is the given date in the same hour as the current date?
14 *
15 * @param date - The date to check
16 * @param options - An object with options
17 *
18 * @returns The date is in this hour
19 *
20 * @example
21 * // If now is 25 September 2014 18:30:15.500,
22 * // is 25 September 2014 18:00:00 in this hour?
23 * const result = isThisHour(new Date(2014, 8, 25, 18))
24 * //=> true
25 */
26export declare function isThisHour(
27 date: DateArg<Date> & {},
28 options?: IsThisHourOptions,
29): boolean;