1.0.0 • Published 6 years ago

is-month v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

is-month

Check if the current month is equalt to the given month

Install

	$ npm install is-month --save

	#or

	$ yarn add is-month

Usage

	import isMonth from 'is-month';

	isMonth('april', { today: new Date('2018/04/12') }) //=> true
	isMonth.promise('april', { today: new Date('2018/04/12') })
		.then(month => {
			console.log('We are in April!')
		})
		.catch(err => {
			if (err) {
				throw err;
			}
		})

Api

isMonth(month, { today })

Returns a boolean.

month

Type: String Month to check

today

Type: Date Default: new Date() Date to check

isMonth.promise(month, { today })

Returns a promise for a boolean.

month

Type: String Month to check

today

Type: Date Default: new Date() Date to check

License

MIT © Federico Vitale