date-selection-manager
Version:
This package takes care of date entries on HTML select elements. It prevents the entry of invalid dates like February 30, June 31, or February 29 on a non-leap year.
21 lines (16 loc) • 470 B
JavaScript
/***
Author: Daniel Okwufulueze
Date: 13/02/2016
*/
const jsdom = require('jsdom');
const { JSDOM } = jsdom;
const documentObject = new JSDOM('<html><body></body></html>');
const windowObject = documentObject.window;
global.document = windowObject.document;
global.DOMParser = windowObject.DOMParser;
global.window = windowObject;
Object.keys(windowObject).forEach((key) => {
if (!(key in global)) {
global[key] = windowObject[key];
}
});