1
0
Fork 0
mirror of synced 2024-09-02 18:51:36 +12:00
budibase/packages/common/node_modules/date-fns/is_first_day_of_month/index.js
2020-04-15 15:23:29 +01:00

22 lines
574 B
JavaScript

var parse = require('../parse/index.js')
/**
* @category Month Helpers
* @summary Is the given date the first day of a month?
*
* @description
* Is the given date the first day of a month?
*
* @param {Date|String|Number} date - the date to check
* @returns {Boolean} the date is the first day of a month
*
* @example
* // Is 1 September 2014 the first day of a month?
* var result = isFirstDayOfMonth(new Date(2014, 8, 1))
* //=> true
*/
function isFirstDayOfMonth (dirtyDate) {
return parse(dirtyDate).getDate() === 1
}
module.exports = isFirstDayOfMonth