budibase/packages/common/node_modules/date-fns/is_monday/index.js

23 lines
478 B
JavaScript
Raw Normal View History

2020-04-07 16:12:08 +02:00
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