Sha256: b605ea5506a8dd4a976daa0dded7fcd6998cba6ca7ab91bb414ab8ee63d3e82f
Contents?: true
Size: 565 Bytes
Versions: 19
Compression:
Stored size: 565 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 doesn't accept years < 1970 if (y < 1970) { date.setFullYear(y); } return date; } export function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); if (y < 1970) { date.setUTCFullYear(y); } return date; }
Version data entries
19 entries across 19 versions & 4 rubygems