Download datalab/web/node_modules/moment/src/lib/create/date-from-array.js from arshjaved/indiaai-hackathon: direct link, hf CLI and curl.
- Browser
- Download file 637 Bytes
-
https://huggingface.co/arshjaved/indiaai-hackathon/resolve/main/datalab/web/node_modules/moment/src/lib/create/date-from-array.js
- Command line
-
hf download hf://arshjaved/indiaai-hackathon/datalab/web/node_modules/moment/src/lib/create/date-from-array.js
-
curl -L -o date-from-array.js https://huggingface.co/arshjaved/indiaai-hackathon/resolve/main/datalab/web/node_modules/moment/src/lib/create/date-from-array.js
637 Bytes
| 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; | |
| } | |