index.js 478 B

12345678910111213141516171819202122
  1. var parse = require('../parse/index.js')
  2. /**
  3. * @category Weekday Helpers
  4. * @summary Is the given date Sunday?
  5. *
  6. * @description
  7. * Is the given date Sunday?
  8. *
  9. * @param {Date|String|Number} date - the date to check
  10. * @returns {Boolean} the date is Sunday
  11. *
  12. * @example
  13. * // Is 21 September 2014 Sunday?
  14. * var result = isSunday(new Date(2014, 8, 21))
  15. * //=> true
  16. */
  17. function isSunday (dirtyDate) {
  18. return parse(dirtyDate).getDay() === 0
  19. }
  20. module.exports = isSunday