isSunday.cjs 598 B

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