Sha256: 4cac3bca33aafec61e4be83826dc6d9a0fb2b8f0d786a50a476aa7cfca3702bd
Contents?: true
Size: 637 Bytes
Versions: 33
Compression:
Stored size: 637 Bytes
Contents
export function createDate (y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 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
33 entries across 32 versions & 4 rubygems