UNPKG

810 BTypeScriptView Raw
1/**
2 * @name isSameYear
3 * @category Year Helpers
4 * @summary Are the given dates in the same year?
5 *
6 * @description
7 * Are the given dates in the same year?
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 dateLeft - The first date to check
12 * @param dateRight - The second date to check
13 *
14 * @returns The dates are in the same year
15 *
16 * @example
17 * // Are 2 September 2014 and 25 September 2014 in the same year?
18 * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
19 * //=> true
20 */
21export declare function isSameYear<DateType extends Date>(
22 dateLeft: DateType | number | string,
23 dateRight: DateType | number | string,
24): boolean;