is-january
Version:
returns a 'true' boolean if date is january
19 lines (15 loc) • 412 B
JavaScript
/*!
* is-january <https://github.com/TJC-js/is-january>
*
* Copyright (c) 2021-current, Tim Cane.
* Released under the MIT License.
*/
;
var isDate = require("is-a-date");
var month = require("month-enum")
module.exports = function isJanuary(value) {
if(!isDate(value)){
throw new Error('expected a date');
}
return value.getMonth() == month.January;
};