Sha256: 5e26386081d919e9ecabd3aefdc35f6d6f5bfd5e38579d79b76288ce3d587f46
Contents?: true
Size: 713 Bytes
Versions: 8
Compression:
Stored size: 713 Bytes
Contents
export function createDate (y, m, d, h, M, s, ms) { //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); //the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; } export function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); //the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; }
Version data entries
8 entries across 8 versions & 3 rubygems