corrade-nucleus-nucleons – Blame information for rev 10
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
10 | office | 1 | export function createDate (y, m, d, h, M, s, ms) { |
2 | // can't just apply() to create a date: |
||
3 | // https://stackoverflow.com/q/181348 |
||
4 | var date = new Date(y, m, d, h, M, s, ms); |
||
5 | |||
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; |
||
11 | } |
||
12 | |||
13 | export function createUTCDate (y) { |
||
14 | var date = new Date(Date.UTC.apply(null, arguments)); |
||
15 | |||
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; |
||
21 | } |