js-joda-timezone
Advanced tools
Comparing version
Changelog | ||
========= | ||
### 1.3.1 (next) | ||
### 1.3.1 | ||
revert previous (breaking) public API change (see https://github.com/js-joda/js-joda-timezone/issues/48) | ||
### 1.3.0 | ||
@@ -7,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
//! @version js-joda-timezone-1.3.0 | ||
//! @version js-joda-timezone-1.3.1 | ||
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors | ||
@@ -52,7 +52,3 @@ //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree) | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | ||
/******/ } | ||
@@ -63,5 +59,24 @@ /******/ }; | ||
/******/ __webpack_require__.r = function(exports) { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ | ||
/******/ // create a fake namespace object | ||
/******/ // mode & 1: value is a module id, require it | ||
/******/ // mode & 2: merge all properties of value into the ns | ||
/******/ // mode & 4: return value when already ns object | ||
/******/ // mode & 8|1: behave like require | ||
/******/ __webpack_require__.t = function(value, mode) { | ||
/******/ if(mode & 1) value = __webpack_require__(value); | ||
/******/ if(mode & 8) return value; | ||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | ||
/******/ var ns = Object.create(null); | ||
/******/ __webpack_require__.r(ns); | ||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | ||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | ||
/******/ return ns; | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
@@ -447,6 +462,6 @@ /******/ __webpack_require__.n = function(module) { | ||
/***/ "./src/auto-plug.js": | ||
/*!**************************!*\ | ||
!*** ./src/auto-plug.js ***! | ||
\**************************/ | ||
/***/ "./src/js-joda-timezone-empty.js": | ||
/*!***************************************!*\ | ||
!*** ./src/js-joda-timezone-empty.js ***! | ||
\***************************************/ | ||
/*! no static exports found */ | ||
@@ -459,6 +474,3 @@ /***/ (function(module, exports, __webpack_require__) { | ||
exports.__esModule = true; | ||
exports.default = autoPlug; | ||
var _jsJoda = __webpack_require__(/*! js-joda */ "js-joda"); | ||
var _plug = __webpack_require__(/*! ./plug */ "./src/plug.js"); | ||
@@ -470,36 +482,11 @@ | ||
/* | ||
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper | ||
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree) | ||
*/ | ||
exports.default = _plug2.default; /* | ||
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper | ||
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree) | ||
*/ | ||
function autoPlug() { | ||
(0, _jsJoda.use)(_plug2.default); | ||
} | ||
module.exports = exports['default']; | ||
/***/ }), | ||
/***/ "./src/js-joda-timezone-empty.js": | ||
/*!***************************************!*\ | ||
!*** ./src/js-joda-timezone-empty.js ***! | ||
\***************************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var _autoPlug = __webpack_require__(/*! ./auto-plug */ "./src/auto-plug.js"); | ||
var _autoPlug2 = _interopRequireDefault(_autoPlug); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
(0, _autoPlug2.default)(); /* | ||
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper | ||
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree) | ||
*/ | ||
/***/ }), | ||
/***/ "./src/plug.js": | ||
@@ -535,2 +522,7 @@ /*!*********************!*\ | ||
module.exports = exports['default']; /* | ||
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper | ||
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree) | ||
*/ | ||
/***/ }), | ||
@@ -570,2 +562,3 @@ | ||
} | ||
module.exports = exports["default"]; | ||
@@ -572,0 +565,0 @@ /***/ }), |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("js-joda")):"function"==typeof define&&define.amd?define(["js-joda"],e):"object"==typeof exports?exports.JSJodaTimezone=e(require("js-joda")):t.JSJodaTimezone=e(t.JSJoda)}(this,function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){var e=function(t){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;return t.of(e)}catch(t){}return null}(t);if(null==e)return;t.systemDefault=function(){return e}}},function(t,e,n){"use strict";function o(t){return t>96?t-87:t>64?t-29:t-48}function r(t){var e=0,n=t.split("."),r=n[0],i=n[1]||"",s=1,f=0,u=1;for(45===t.charCodeAt(0)&&(e=1,u=-1);e<r.length;e++)f=60*f+o(r.charCodeAt(e));for(e=0;e<i.length;e++)s/=60,f+=o(i.charCodeAt(e))*s;return f*u}function i(t){for(var e=0;e<t.length;e++)t[e]=r(t[e])}function s(t,e){var n,o=[];for(n=0;n<e.length;n++)o[n]=t[e[n]];return o}e.__esModule=!0,e.unpack=function(t){var e=t.split("|"),n=e[2].split(" "),o=e[3].split(""),r=e[4].split(" ");return i(n),i(o),i(r),function(t,e){for(var n=0;n<e;n++)t[n]=Math.round((t[n-1]||0)+6e4*t[n]);t[e-1]=1/0}(r,o.length),{name:e[0],abbrs:s(e[1].split(" "),o),offsets:s(n,o),untils:r,population:0|e[5]}}},function(t,e,n){"use strict";e.__esModule=!0,e.MomentZoneRules=void 0;var o=n(0);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.MomentZoneRules=function(t){function e(n){r(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return o._tzdbInfo=n,o._ldtUntils=new i(o._tzdbInfo.untils,o._tzdbInfo.offsets),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.isFixedOffset=function(){return 1===this._tzdbInfo.offsets.length},e.prototype.offsetOfInstant=function(t){var e=t.toEpochMilli();return this.offsetOfEpochMilli(e)},e.prototype.offsetOfEpochMilli=function(t){var e=function(t,e){var n=t.length-1,o=-1,r=void 0;for(;n-o>1;)t[r=n+o>>1]<=e?o=r:n=r;return n}(this._tzdbInfo.untils,t);return o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(e))},e.prototype.offsetOfLocalDateTime=function(t){var e=this._offsetInfo(t);return e instanceof o.ZoneOffsetTransition?e.offsetBefore():e},e.prototype._offsetInfo=function(t){var e=function(t,e){var n=t.size-1,o=-1,r=void 0;for(;n-o>1;)e.isBefore(t.get(r=n+o>>1))?n=r:o=r;return n}(this._ldtUntils,t),n=e>>1;if(e%2==1){var r=this._ldtUntils.get(Math.max(e-1,0)),i=this._ldtUntils.get(Math.min(e,this._ldtUntils.size-1)),s=o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(n)),f=o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(Math.min(n+1,this._tzdbInfo.offsets.length-1)));return s.compareTo(f)>0?o.ZoneOffsetTransition.of(r,s,f):o.ZoneOffsetTransition.of(i,s,f)}return o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(n))},e.prototype._offsetByIndexInSeconds=function(t){return-s(this._tzdbInfo.offsets[t])},e.prototype.validOffsets=function(t){var e=this._offsetInfo(t);return e instanceof o.ZoneOffsetTransition?e.validOffsets():[e]},e.prototype.transition=function(t){var e=this._offsetInfo(t);return e instanceof o.ZoneOffsetTransition?e:null},e.prototype.standardOffset=function(t){f("ZoneRules.standardOffset")},e.prototype.daylightSavings=function(t){f("ZoneRules.daylightSavings")},e.prototype.isDaylightSavings=function(t){f("ZoneRules.isDaylightSavings")},e.prototype.isValidOffset=function(t,e){return this.validOffsets(t).some(function(t){return t.equals(e)})},e.prototype.nextTransition=function(t){f("ZoneRules.nextTransition")},e.prototype.previousTransition=function(t){f("ZoneRules.previousTransition")},e.prototype.transitions=function(){f("ZoneRules.transitions")},e.prototype.transitionRules=function(){f("ZoneRules.transitionRules")},e.prototype.equals=function(t){return this===t||t instanceof e&&this._tzdbInfo===t._tzdbInfo},e.prototype.toString=function(){return this._tzdbInfo.name},e}(o.ZoneRules);var i=function(){function t(e,n){r(this,t),this._tzdbUntils=e,this._tzdbOffsets=n,this._ldtUntils=[],this.size=2*this._tzdbUntils.length}return t.prototype._generateTupple=function(t){var e=this._tzdbUntils[t];if(e===1/0)return[o.LocalDateTime.MAX,o.LocalDateTime.MAX];var n=o.Instant.ofEpochMilli(e),r=s(this._tzdbOffsets[t]),i=o.ZoneOffset.ofTotalSeconds(-r),f=o.LocalDateTime.ofInstant(n,i),u=Math.min(t+1,this._tzdbOffsets.length-1),a=s(this._tzdbOffsets[u]),l=o.ZoneOffset.ofTotalSeconds(-a),c=o.LocalDateTime.ofInstant(n,l);return r>a?[f,c]:[c,f]},t.prototype._getTupple=function(t){return null==this._ldtUntils[t]&&(this._ldtUntils[t]=this._generateTupple(t)),this._ldtUntils[t]},t.prototype.get=function(t){return this._getTupple(t>>1)[t%2]},t}();function s(t){return(e=60*+t)<0?Math.ceil(e):Math.floor(e);var e}function f(t){throw new Error("not supported: "+t)}},function(t,e,n){"use strict";e.__esModule=!0,e.MomentZoneRulesProvider=void 0;var o=n(0),r=n(3),i=n(2);var s=void 0,f=void 0,u=[],a={},l={};e.MomentZoneRulesProvider=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.getRules=function(t){var e=a[l[t]];if(null==e)throw new o.DateTimeException("Unknown time-zone ID: "+t);return new r.MomentZoneRules(e)},e.getAvailableZoneIds=function(){return u},e.getVersion=function(){return f},e.getTzdbData=function(){return s},e.loadTzdbData=function(t){s=t,f=t.version;var e=t.zones,n=Array.isArray(e),o=0;for(e=n?e:e[Symbol.iterator]();;){var r;if(n){if(o>=e.length)break;r=e[o++]}else{if((o=e.next()).done)break;r=o.value}var c=r,d=(0,i.unpack)(c);u.push(d.name),a[d.name]=d,l[d.name]=d.name}var p=t.links,h=Array.isArray(p),v=0;for(p=h?p:p[Symbol.iterator]();;){var _;if(h){if(v>=p.length)break;_=p[v++]}else{if((v=p.next()).done)break;_=v.value}var y=_.split("|");u.push(y[1]),l[y[1]]=y[0]}},e}(o.ZoneRulesProvider)},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){return t.ZoneRulesProvider.getRules=r.MomentZoneRulesProvider.getRules,t.ZoneRulesProvider.getAvailableZoneIds=r.MomentZoneRulesProvider.getAvailableZoneIds,t.ZoneRulesProvider.getTzdbData=r.MomentZoneRulesProvider.getTzdbData,t.ZoneRulesProvider.loadTzdbData=r.MomentZoneRulesProvider.loadTzdbData,(0,s.default)(t.ZoneId),t};var o,r=n(4),i=n(1),s=(o=i)&&o.__esModule?o:{default:o}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(){(0,r.use)(s.default)};var o,r=n(0),i=n(5),s=(o=i)&&o.__esModule?o:{default:o}},function(t,e,n){"use strict";var o,r=n(6);(0,((o=r)&&o.__esModule?o:{default:o}).default)()}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("js-joda")):"function"==typeof define&&define.amd?define(["js-joda"],e):"object"==typeof exports?exports.JSJodaTimezone=e(require("js-joda")):t.JSJodaTimezone=e(t.JSJoda)}(this,function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(e,n){e.exports=t},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){var e=function(t){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;return t.of(e)}catch(t){}return null}(t);if(null==e)return;t.systemDefault=function(){return e}},t.exports=e.default},function(t,e,n){"use strict";function o(t){return t>96?t-87:t>64?t-29:t-48}function r(t){var e=0,n=t.split("."),r=n[0],i=n[1]||"",s=1,f=0,u=1;for(45===t.charCodeAt(0)&&(e=1,u=-1);e<r.length;e++)f=60*f+o(r.charCodeAt(e));for(e=0;e<i.length;e++)s/=60,f+=o(i.charCodeAt(e))*s;return f*u}function i(t){for(var e=0;e<t.length;e++)t[e]=r(t[e])}function s(t,e){var n,o=[];for(n=0;n<e.length;n++)o[n]=t[e[n]];return o}e.__esModule=!0,e.unpack=function(t){var e=t.split("|"),n=e[2].split(" "),o=e[3].split(""),r=e[4].split(" ");return i(n),i(o),i(r),function(t,e){for(var n=0;n<e;n++)t[n]=Math.round((t[n-1]||0)+6e4*t[n]);t[e-1]=1/0}(r,o.length),{name:e[0],abbrs:s(e[1].split(" "),o),offsets:s(n,o),untils:r,population:0|e[5]}}},function(t,e,n){"use strict";e.__esModule=!0,e.MomentZoneRules=void 0;var o=n(0);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.MomentZoneRules=function(t){function e(n){r(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return o._tzdbInfo=n,o._ldtUntils=new i(o._tzdbInfo.untils,o._tzdbInfo.offsets),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.isFixedOffset=function(){return 1===this._tzdbInfo.offsets.length},e.prototype.offsetOfInstant=function(t){var e=t.toEpochMilli();return this.offsetOfEpochMilli(e)},e.prototype.offsetOfEpochMilli=function(t){var e=function(t,e){var n=t.length-1,o=-1,r=void 0;for(;n-o>1;)t[r=n+o>>1]<=e?o=r:n=r;return n}(this._tzdbInfo.untils,t);return o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(e))},e.prototype.offsetOfLocalDateTime=function(t){var e=this._offsetInfo(t);return e instanceof o.ZoneOffsetTransition?e.offsetBefore():e},e.prototype._offsetInfo=function(t){var e=function(t,e){var n=t.size-1,o=-1,r=void 0;for(;n-o>1;)e.isBefore(t.get(r=n+o>>1))?n=r:o=r;return n}(this._ldtUntils,t),n=e>>1;if(e%2==1){var r=this._ldtUntils.get(Math.max(e-1,0)),i=this._ldtUntils.get(Math.min(e,this._ldtUntils.size-1)),s=o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(n)),f=o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(Math.min(n+1,this._tzdbInfo.offsets.length-1)));return s.compareTo(f)>0?o.ZoneOffsetTransition.of(r,s,f):o.ZoneOffsetTransition.of(i,s,f)}return o.ZoneOffset.ofTotalSeconds(this._offsetByIndexInSeconds(n))},e.prototype._offsetByIndexInSeconds=function(t){return-s(this._tzdbInfo.offsets[t])},e.prototype.validOffsets=function(t){var e=this._offsetInfo(t);return e instanceof o.ZoneOffsetTransition?e.validOffsets():[e]},e.prototype.transition=function(t){var e=this._offsetInfo(t);return e instanceof o.ZoneOffsetTransition?e:null},e.prototype.standardOffset=function(t){f("ZoneRules.standardOffset")},e.prototype.daylightSavings=function(t){f("ZoneRules.daylightSavings")},e.prototype.isDaylightSavings=function(t){f("ZoneRules.isDaylightSavings")},e.prototype.isValidOffset=function(t,e){return this.validOffsets(t).some(function(t){return t.equals(e)})},e.prototype.nextTransition=function(t){f("ZoneRules.nextTransition")},e.prototype.previousTransition=function(t){f("ZoneRules.previousTransition")},e.prototype.transitions=function(){f("ZoneRules.transitions")},e.prototype.transitionRules=function(){f("ZoneRules.transitionRules")},e.prototype.equals=function(t){return this===t||t instanceof e&&this._tzdbInfo===t._tzdbInfo},e.prototype.toString=function(){return this._tzdbInfo.name},e}(o.ZoneRules);var i=function(){function t(e,n){r(this,t),this._tzdbUntils=e,this._tzdbOffsets=n,this._ldtUntils=[],this.size=2*this._tzdbUntils.length}return t.prototype._generateTupple=function(t){var e=this._tzdbUntils[t];if(e===1/0)return[o.LocalDateTime.MAX,o.LocalDateTime.MAX];var n=o.Instant.ofEpochMilli(e),r=s(this._tzdbOffsets[t]),i=o.ZoneOffset.ofTotalSeconds(-r),f=o.LocalDateTime.ofInstant(n,i),u=Math.min(t+1,this._tzdbOffsets.length-1),a=s(this._tzdbOffsets[u]),l=o.ZoneOffset.ofTotalSeconds(-a),c=o.LocalDateTime.ofInstant(n,l);return r>a?[f,c]:[c,f]},t.prototype._getTupple=function(t){return null==this._ldtUntils[t]&&(this._ldtUntils[t]=this._generateTupple(t)),this._ldtUntils[t]},t.prototype.get=function(t){return this._getTupple(t>>1)[t%2]},t}();function s(t){return function(t){return t<0?Math.ceil(t):Math.floor(t)}(60*+t)}function f(t){throw new Error("not supported: "+t)}},function(t,e,n){"use strict";e.__esModule=!0,e.MomentZoneRulesProvider=void 0;var o=n(0),r=n(3),i=n(2);var s=void 0,f=void 0,u=[],a={},l={};e.MomentZoneRulesProvider=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.getRules=function(t){var e=a[l[t]];if(null==e)throw new o.DateTimeException("Unknown time-zone ID: "+t);return new r.MomentZoneRules(e)},e.getAvailableZoneIds=function(){return u},e.getVersion=function(){return f},e.getTzdbData=function(){return s},e.loadTzdbData=function(t){s=t,f=t.version;var e=t.zones,n=Array.isArray(e),o=0;for(e=n?e:e[Symbol.iterator]();;){var r;if(n){if(o>=e.length)break;r=e[o++]}else{if((o=e.next()).done)break;r=o.value}var c=r,d=(0,i.unpack)(c);u.push(d.name),a[d.name]=d,l[d.name]=d.name}var p=t.links,h=Array.isArray(p),v=0;for(p=h?p:p[Symbol.iterator]();;){var y;if(h){if(v>=p.length)break;y=p[v++]}else{if((v=p.next()).done)break;y=v.value}var b=y.split("|");u.push(b[1]),l[b[1]]=b[0]}},e}(o.ZoneRulesProvider)},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){return t.ZoneRulesProvider.getRules=o.MomentZoneRulesProvider.getRules,t.ZoneRulesProvider.getAvailableZoneIds=o.MomentZoneRulesProvider.getAvailableZoneIds,t.ZoneRulesProvider.getTzdbData=o.MomentZoneRulesProvider.getTzdbData,t.ZoneRulesProvider.loadTzdbData=o.MomentZoneRulesProvider.loadTzdbData,(0,r.default)(t.ZoneId),t};var o=n(4),r=function(t){return t&&t.__esModule?t:{default:t}}(n(1));t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var o=function(t){return t&&t.__esModule?t:{default:t}}(n(5));e.default=o.default,t.exports=e.default}])}); |
@@ -1,1 +0,1 @@ | ||
export { }; | ||
export default function plug(jsJoda: any):any; |
{ | ||
"name": "js-joda-timezone", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "iana tzdb timezone bindings for js-joda", | ||
@@ -50,2 +50,3 @@ "typings": "dist/js-joda-timezone.d.ts", | ||
"babel-loader": "^7.1.4", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-istanbul": "^4.1.5", | ||
@@ -52,0 +53,0 @@ "babel-preset-es2015": "^6.24.1", |
@@ -27,6 +27,6 @@ # js-joda-timezone | ||
var jsJoda = require('js-joda') | ||
require('js-joda-timezone') | ||
const jsJoda = require('js-joda') | ||
.use(require('js-joda-timezone')) | ||
var { LocalDateTime, ZoneId, ZonedDateTime } = jsJoda; | ||
const { LocalDateTime, ZoneId, ZonedDateTime } = jsJoda; | ||
@@ -50,5 +50,7 @@ LocalDateTime | ||
import { ZonedDateTime, ZoneId } from 'js-joda' | ||
import 'js-joda-timezone' | ||
import { use as jsJodaUse, ZonedDateTime, ZoneId } from 'js-joda' | ||
import jsJodaTimeZone from 'js-joda-timezone' | ||
jsJodaUse(jsJodaTimeZone) | ||
const zdt = ZonedDateTime.now(ZoneId.of('America/New_York')) | ||
@@ -61,2 +63,5 @@ | ||
<script> | ||
// use js-joda-timezone | ||
JSJoda.use(JSJodaTimezone) | ||
// copy all js-joda classes to the global scope | ||
@@ -63,0 +68,0 @@ for(let key in JSJoda) { this[key] = JSJoda[key]; } |
@@ -6,4 +6,4 @@ /* | ||
import autoPlug from './auto-plug'; | ||
import plug from './plug'; | ||
autoPlug(); | ||
export default plug; |
@@ -6,9 +6,9 @@ /* | ||
import latest from './tzdbData'; | ||
import latest from '../data/packed/latest'; | ||
import plug from './plug'; | ||
import { MomentZoneRulesProvider } from './MomentZoneRulesProvider'; | ||
import autoPlug from './auto-plug'; | ||
MomentZoneRulesProvider.loadTzdbData(latest); | ||
autoPlug(); | ||
export default plug; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
550579
0.5%97
5.43%32
3.23%20
-13.04%2337
-0.93%1
Infinity%