Brought in another asset for Ray's eye form: moment
[openemr.git] / public / assets / moment-2-13-0 / src / lib / create / date-from-array.js
blob180f55c717f5a04aff83f95c912a50e62bc01ebd
1 export function createDate (y, m, d, h, M, s, ms) {
2     //can't just apply() to create a date:
3     //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
4     var date = new Date(y, m, d, h, M, s, ms);
6     //the date constructor remaps years 0-99 to 1900-1999
7     if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
8         date.setFullYear(y);
9     }
10     return date;
13 export function createUTCDate (y) {
14     var date = new Date(Date.UTC.apply(null, arguments));
16     //the Date.UTC function remaps years 0-99 to 1900-1999
17     if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
18         date.setUTCFullYear(y);
19     }
20     return date;