UNPKG

is-october

Version:

returns a 'true' boolean if date is october

19 lines (15 loc) 413 B
/*! * is-october <https://github.com/TJC-js/is-october> * * Copyright (c) 2021-current, Tim Cane. * Released under the MIT License. */ 'use strict'; var isDate = require("is-a-date"); var month = require("month-enum"); module.exports = function isOctober(value) { if(!isDate(value)){ throw new Error('expected a date'); } return value.getMonth() == month.October; };