mirror of https://github.com/lukechilds/docs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
478 B
23 lines
478 B
6 years ago
|
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
|