isWeekend.d.ts 662 B

12345678910111213141516171819202122
  1. /**
  2. * @name isWeekend
  3. * @category Weekday Helpers
  4. * @summary Does the given date fall on a weekend?
  5. *
  6. * @description
  7. * Does the given date fall on a weekend?
  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 falls on a weekend
  14. *
  15. * @example
  16. * // Does 5 October 2014 fall on a weekend?
  17. * const result = isWeekend(new Date(2014, 9, 5))
  18. * //=> true
  19. */
  20. export declare function isWeekend<DateType extends Date>(
  21. date: DateType | number | string,
  22. ): boolean;