travel/admin/node_modules/date-fns/is_sunday/index.js

23 lines
478 B
JavaScript

var parse = require('../parse/index.js')
/**
* @category Weekday Helpers
* @summary Is the given date Sunday?
*
* @description
* Is the given date Sunday?
*
* @param {Date|String|Number} date - the date to check
* @returns {Boolean} the date is Sunday
*
* @example
* // Is 21 September 2014 Sunday?
* var result = isSunday(new Date(2014, 8, 21))
* //=> true
*/
function isSunday (dirtyDate) {
return parse(dirtyDate).getDay() === 0
}
module.exports = isSunday