is-christmas-period

1.0.1 • Public • Published

is-christmas-period

Identify whether the current or given date is about Christmas period.

Install

npm install -g is-christmas-period

Use

1. Load the module

var isChristmasPeriod = require('is-christmas-period');

2. Check if current date is about Christmas period

console.log(isChristmasPeriod()); // true or false

Other Examples

20th of December is about Christmas period

var twentiethOfDecember = new Date();
twentiethOfDecember.setDate(20);
twentiethOfDecember.setMonth(11);
 
isChristmasPeriod(twentiethOfDecember); // true

8th of February is not about Christmas period

var eightthOfFebruary = new Date();
eightthOfFebruary.setDate(8);
eightthOfFebruary.setMonth(1);
 
isChristmasPeriod(eightthOfFebruary); // false

Test

To execute tests, first install the project dependencies:

$ npm install

Then, run the tests

$ npm test

Credits

Many thanks to EditThisCookie Chrome extension.

/is-christmas-period/

    Package Sidebar

    Install

    npm i is-christmas-period

    Weekly Downloads

    2

    Version

    1.0.1

    License

    Apache-2.0

    Last publish

    Collaborators

    • toubou