isThisYear.d.mts 729 B

1234567891011121314151617181920212223
  1. /**
  2. * @name isThisYear
  3. * @category Year Helpers
  4. * @summary Is the given date in the same year as the current date?
  5. * @pure false
  6. *
  7. * @description
  8. * Is the given date in the same year 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 year
  15. *
  16. * @example
  17. * // If today is 25 September 2014, is 2 July 2014 in this year?
  18. * const result = isThisYear(new Date(2014, 6, 2))
  19. * //=> true
  20. */
  21. export declare function isThisYear<DateType extends Date>(
  22. date: DateType | number | string,
  23. ): boolean;