UNPKG

794 BTypeScriptView Raw
1/**
2 * @name isThisSecond
3 * @category Second Helpers
4 * @summary Is the given date in the same second as the current date?
5 * @pure false
6 *
7 * @description
8 * Is the given date in the same second 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 second
15 *
16 * @example
17 * // If now is 25 September 2014 18:30:15.500,
18 * // is 25 September 2014 18:30:15.000 in this second?
19 * const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))
20 * //=> true
21 */
22export declare function isThisSecond<DateType extends Date>(
23 date: DateType | number | string,
24): boolean;