isLeapYear.d.mts 656 B

12345678910111213141516171819202122
  1. /**
  2. * @name isLeapYear
  3. * @category Year Helpers
  4. * @summary Is the given date in the leap year?
  5. *
  6. * @description
  7. * Is the given date in the leap 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 date - The date to check
  12. *
  13. * @returns The date is in the leap year
  14. *
  15. * @example
  16. * // Is 1 September 2012 in the leap year?
  17. * const result = isLeapYear(new Date(2012, 8, 1))
  18. * //=> true
  19. */
  20. export declare function isLeapYear<DateType extends Date>(
  21. date: DateType | number | string,
  22. ): boolean;