MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / createUTCDate

Function createUTCDate

tests/test_code/js/moment/moment.js:1293–1309  ·  view source on GitHub ↗
(y)

Source from the content-addressed store, hash-verified

1291 }
1292
1293 function createUTCDate(y) {
1294 var date, args;
1295 // the Date.UTC function remaps years 0-99 to 1900-1999
1296 if (y < 100 && y >= 0) {
1297 args = Array.prototype.slice.call(arguments);
1298 // preserve leap years using a full 400 year cycle, then reset
1299 args[0] = y + 400;
1300 date = new Date(Date.UTC.apply(null, args));
1301 if (isFinite(date.getUTCFullYear())) {
1302 date.setUTCFullYear(y);
1303 }
1304 } else {
1305 date = new Date(Date.UTC.apply(null, arguments));
1306 }
1307
1308 return date;
1309 }
1310
1311 // start-of-first-week - start-of-year
1312 function firstWeekOffset(year, dow, doy) {

Callers 3

firstWeekOffsetFunction · 0.85
configFromArrayFunction · 0.85
setWeekAllFunction · 0.85

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected