23 lines
478 B
JavaScript
23 lines
478 B
JavaScript
var parse = require('../parse/index.js')
|
|
|
|
/**
|
|
* @category Weekday Helpers
|
|
* @summary Is the given date Monday?
|
|
*
|
|
* @description
|
|
* Is the given date Monday?
|
|
*
|
|
* @param {Date|String|Number} date - the date to check
|
|
* @returns {Boolean} the date is Monday
|
|
*
|
|
* @example
|
|
* // Is 22 September 2014 Monday?
|
|
* var result = isMonday(new Date(2014, 8, 22))
|
|
* //=> true
|
|
*/
|
|
function isMonday (dirtyDate) {
|
|
return parse(dirtyDate).getDay() === 1
|
|
}
|
|
|
|
module.exports = isMonday
|