Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add package.json for npm and make code an UMD module #73

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions js/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/*! DatePicker v6.3.6 MIT/GPL2 @freqdec */
var datePickerController = (function datePickerController() {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(factory);
} else if (typeof exports === 'object') {
// Node, CommonJS-like
module.exports = factory();
} else {
// Browser globals (root is window)
root.datePickerController = factory();
}
}(this, function() {

"use strict";

Expand Down Expand Up @@ -2891,7 +2902,7 @@ var datePickerController = (function datePickerController() {
};
datePickers = null;

removeEvent(window, 'unload', datePickerController.destroy);
removeEvent(window, 'unload', destroy);
};
var destroySingleDatePicker = function(id) {
if(id && (id in datePickers)) {
Expand Down Expand Up @@ -3544,4 +3555,4 @@ var datePickerController = (function datePickerController() {
// Converts Date Object to a YYYYMMDD formatted String
dateToYYYYMMDDStr: function(dt) { return dateToYYYYMMDD(dt); }
};
})();
}))
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "datepicker",
"version": "1.0.0",
"description": "Accessible, simple datepicker.",
"main": "js/datepicker.js",
"repository": {
"type": "git",
"url": "git+https://github.com/freqdec/datePicker.git"
},
"author": "freqdec",
"license": "MIT",
"bugs": {
"url": "https://github.com/freqdec/datePicker/issues"
},
"homepage": "https://github.com/freqdec/datePicker#readme"
}