js-joda-timezone
Advanced tools
Comparing version
Changelog | ||
========= | ||
### 1.1.7 (next) | ||
### 1.2.1 (next) | ||
### 1.2.0 | ||
#### public api | ||
* remove private export of tzdb data, instead | ||
* add loadTzdbData() and getTzdbData() static methods to the class ZoneRulesProvider, | ||
that allows to provide/share tzdb data. | ||
* provide empty dist versions of js-joda-timezone without preconfigured tzdb data. | ||
#### iana tzdb | ||
* manually updated iana tzdb to 2018c | ||
#### dependendency updates | ||
### 1.1.6 | ||
@@ -7,0 +22,0 @@ |
{ | ||
"name": "js-joda-timezone", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "iana tzdb timezone bindings for js-joda", | ||
@@ -15,10 +15,10 @@ "typings": "dist/js-joda-timezone.d.ts", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha --timeout 5000 --compilers js:babel-core/register ./test/*Test.js ./test/**/*Test.js", | ||
"test-coverage": "NODE_ENV=test COVERAGE=1 ./node_modules/.bin/nyc --report-dir=build/coverage --reporter=lcov --reporter html ./node_modules/.bin/mocha --timeout 5000 --compilers js:babel-core/register --reporter progress ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js", | ||
"test": "./node_modules/.bin/mocha --timeout 5000 --require babel-core/register ./test/*Test.js ./test/**/*Test.js", | ||
"test-coverage": "NODE_ENV=test COVERAGE=1 ./node_modules/.bin/nyc --report-dir=build/coverage --reporter=lcov --reporter html ./node_modules/.bin/mocha --timeout 5000 --require babel-core/register --reporter progress ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js", | ||
"test-browser": "./node_modules/.bin/karma start --reporters=dots --single-run", | ||
"test-ts-definitions": "tsc --noImplicitAny --noEmit --pretty test/typescript_defintions/js-joda-timezone-tests.ts", | ||
"test-saucelabs": "./node_modules/.bin/karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie_9,sl_firefox\" --single-run=true", | ||
"test-saucelabs": "./node_modules/.bin/karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie,sl_firefox\" --single-run=true", | ||
"test-ci": "npm run build-dist && npm run test && npm run test-browser && npm run test-ts-definitions && npm run build-esdoc && npm run test-coverage", | ||
"build-esdoc": "./node_modules/.bin/esdoc -c esdoc.json", | ||
"build-dist": "./node_modules/.bin/webpack --progress --colors --bail && DIST_MIN=1 ./node_modules/.bin/webpack --progress --colors --bail", | ||
"build-dist": "./node_modules/.bin/webpack --progress --colors --bail", | ||
"lint": "./node_modules/.bin/eslint ." | ||
@@ -45,3 +45,3 @@ }, | ||
"peerDependencies": { | ||
"js-joda": "^1.6.2" | ||
"js-joda": "^1.8.0" | ||
}, | ||
@@ -51,3 +51,3 @@ "devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-loader": "^7.1.4", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
@@ -60,5 +60,5 @@ "babel-plugin-istanbul": "^4.1.5", | ||
"esdoc-standard-plugin": "^1.0.0", | ||
"eslint": "^4.16.0", | ||
"eslint": "^4.18.2", | ||
"eslint-config-js-joda": "^1.0.0", | ||
"js-joda": "^1.6.2", | ||
"js-joda": "^1.8.0", | ||
"json-loader": "^0.5.7", | ||
@@ -73,10 +73,12 @@ "karma": "^2.0.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^2.0.9", | ||
"karma-webpack": "^2.0.13", | ||
"markdown-toc": "^1.2.0", | ||
"mocha": "^4.0.1", | ||
"mocha": "^5.0.4", | ||
"moment-timezone": "^0.5.14", | ||
"nyc": "^11.4.1", | ||
"nyc": "^11.6.0", | ||
"phantomjs-prebuilt": "^2.1.16", | ||
"typescript": "^2.6.2", | ||
"webpack": "^3.10.0" | ||
"typescript": "^2.7.2", | ||
"uglifyjs-webpack-plugin": "^1.2.4", | ||
"webpack": "^4.1.1", | ||
"webpack-cli": "^2.0.12" | ||
}, | ||
@@ -83,0 +85,0 @@ "license": "BSD-3-Clause", |
/* | ||
* @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper | ||
* @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) | ||
*/ | ||
import latest from '../data/packed/latest'; | ||
import plug from './plug'; | ||
import { MomentZoneRulesProvider } from './MomentZoneRulesProvider'; | ||
MomentZoneRulesProvider.loadTzdbData(latest); | ||
export default plug; |
@@ -1,2 +0,2 @@ | ||
//! @copyright (c) 2015-2016, Philipp Thürwächter, Pattrick Hüper & js-joda contributors | ||
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors | ||
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree) |
/* | ||
* @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper | ||
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper | ||
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos | ||
@@ -4,0 +4,0 @@ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree) |
/* | ||
* @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper | ||
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper | ||
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos | ||
@@ -16,3 +16,4 @@ * @license BSD-3-Clause (see LICENSE in the root directory of this source tree) | ||
let TZDB_VERSION = null; | ||
let TZDB_DATA; | ||
let TZDB_VERSION; | ||
const AVAILABLE_ZONE_IDS = []; | ||
@@ -54,2 +55,6 @@ | ||
/** | ||
* | ||
* @return {string} the tzdb version. | ||
*/ | ||
static getVersion() { | ||
@@ -59,3 +64,20 @@ return TZDB_VERSION; | ||
static loadData(packedJson){ | ||
/** | ||
* Provides the packed tzdb data, | ||
* the data has the same format as provided from moment-timezone. | ||
* | ||
* @return {object} the packed tzdb data. | ||
*/ | ||
static getTzdbData(){ | ||
return TZDB_DATA; | ||
} | ||
/** | ||
* Sets the packed tzdb data. | ||
* Accepts tzdb data in the same format as provided from moment-timezone. | ||
* | ||
* @param packedJson | ||
*/ | ||
static loadTzdbData(packedJson){ | ||
TZDB_DATA = packedJson; | ||
TZDB_VERSION = packedJson.version; | ||
@@ -62,0 +84,0 @@ |
/* | ||
* @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper | ||
* @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) | ||
*/ | ||
import latest from 'moment-timezone/data/packed/latest'; | ||
import { MomentZoneRulesProvider } from './MomentZoneRulesProvider'; | ||
import extendSystemDefaultZoneId from './system-default-zone'; | ||
MomentZoneRulesProvider.loadData(latest); | ||
export default function (jsJoda) { | ||
jsJoda.ZoneRulesProvider.getRules = MomentZoneRulesProvider.getRules; | ||
jsJoda.ZoneRulesProvider.getAvailableZoneIds = MomentZoneRulesProvider.getAvailableZoneIds; | ||
jsJoda.ZoneRulesProvider.getTzdbData = MomentZoneRulesProvider.getTzdbData; | ||
jsJoda.ZoneRulesProvider.loadTzdbData = MomentZoneRulesProvider.loadTzdbData; | ||
// TODO This is temporay solution to get access to the tzdb data. | ||
// It would be nice to decouple load and set tzdb data | ||
// and to provide a possiblitiy to load only a subset of zoneIds. | ||
// Be aware that this is an undocumented feature and | ||
// that the format of the tzdb might change in the future! | ||
jsJoda.ZoneRulesProvider._TZDB = latest; | ||
extendSystemDefaultZoneId(jsJoda.ZoneId); | ||
return jsJoda; | ||
} |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
20
25%2307
34.21%544804
-15.57%32
6.67%2
100%