index.min.js.map
1.97 KB
{"version":3,"sources":["index.js"],"names":[],"mappings":"AAAA,aAEA,MAAM,CAAC,cAAP,CAAsB,OAAtB,CAA+B,YAA/B,CAA6C,CAC3C,KAAK,CAAE,IADoC,CAA7C,EAGA,OAAO,CAAC,UAAR,CAAqB,UAArB,CAWA,QAAS,CAAA,UAAT,CAAoB,CAApB,CAAuB,CACrB,GAAI,CAAC,CAAL,CAAQ,CAAC,CAAG,GAAI,CAAA,IAAR,CACR,GAAI,sBAAsB,IAAtB,CAA2B,CAA3B,CAAJ,CAAmC,MAAO,CAAA,CAAP,CAEnC,GAAI,cAAc,IAAd,CAAmB,CAAnB,CAAJ,CAA2B,CAEzB,GAAI,CAAC,CAAG,UAAR,CAAoB,CAAC,EAAI,IAAL,CAEpB,GAAI,CAAC,CAAG,aAAR,CAAuB,CAAC,EAAI,IAAL,CAEvB,GAAI,CAAC,CAAG,aAAR,CAAuB,CAAC,EAAI,IAC7B,CAED,GAAI,EAAE,CAAC,WAAY,CAAA,IAAf,CAAJ,CAA0B,CAAC,CAAG,GAAI,CAAA,IAAJ,CAAS,CAAT,CAAJ,CAE1B,MAAO,IAAI,CAAA,IAAJ,CAAS,CAAC,CAAG,CAAC,CAAC,iBAAF,GAAwB,KAArC,EACN,WADM,GACQ,KADR,CACc,CADd,CACiB,CAAC,CADlB,CAER","file":"index.min.js","sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.localISOdt = localISOdt;\n\n/* eslint-disable no-param-reassign */\n\n/**\n * Convert the most common types of dates to the ISO8601/RFC3339 format,\n * in the local time zone, without milliseconds\n * @param {Date|Number|String} [d = Date.now()] - the date, either a Date object,\n * or a UNIX timestamp in (milli/micro/nano)seconds\n * @return {String} ISO8601/RFC3339 `YYYY-MM-DDTHH:MM:SS` string in the local timezone\n */\nfunction localISOdt(d) {\n if (!d) d = new Date();\n if (/^\\d\\d\\d\\d-\\d\\d-\\d\\d/.test(d)) return d; // leave YYYY-MM-DD strings unchanged\n\n if (/^\\d+\\.?\\d*$/.test(d)) {\n // We have a (possibly fractional) number. Date takes a millisecond argument, so\n if (d < 4102512345) d *= 1000; // ...interpret as seconds if before 1/1/2100\n\n if (d > 4102512345000) d /= 1000; // ...and as microseconds if after 1/1/2100\n\n if (d > 4102512345000) d /= 1000; // ...and finally as nanoseconds\n }\n\n if (!(d instanceof Date)) d = new Date(d); // parse it\n\n return new Date(d - d.getTimezoneOffset() * 60000) // the offset is in minutes\n .toISOString().slice(0, -5); // drop the .milliseconds and 'Z';\n}\n"]}