isFriday.cjs 602 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. exports.isFriday = isFriday;
  3. var _index = require("./toDate.cjs");
  4. /**
  5. * The {@link isFriday} function options.
  6. */
  7. /**
  8. * @name isFriday
  9. * @category Weekday Helpers
  10. * @summary Is the given date Friday?
  11. *
  12. * @description
  13. * Is the given date Friday?
  14. *
  15. * @param date - The date to check
  16. * @param options - An object with options
  17. *
  18. * @returns The date is Friday
  19. *
  20. * @example
  21. * // Is 26 September 2014 Friday?
  22. * const result = isFriday(new Date(2014, 8, 26))
  23. * //=> true
  24. */
  25. function isFriday(date, options) {
  26. return (0, _index.toDate)(date, options?.in).getDay() === 5;
  27. }