Comparing version 2.1.1 to 2.2.0
{ | ||
"name": "luxon", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Immutable date wrapper", | ||
@@ -32,6 +32,6 @@ "author": "Isaac Cambron", | ||
"devDependencies": { | ||
"@babel/core": "^7.14.6", | ||
"@babel/node": "^7.14.7", | ||
"@babel/plugin-external-helpers": "^7.14.5", | ||
"@babel/preset-env": "^7.14.7", | ||
"@babel/core": "^7.16.0", | ||
"@babel/node": "^7.16.0", | ||
"@babel/plugin-external-helpers": "^7.16.0", | ||
"@babel/preset-env": "^7.16.0", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
@@ -38,0 +38,0 @@ "@rollup/plugin-commonjs": "^19.0.0", |
@@ -704,3 +704,3 @@ import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from "./errors.js"; | ||
built[k] = i; | ||
accumulated[k] = own - i; // we'd like to absorb these fractions in another unit | ||
accumulated[k] = (own * 1000 - i * 1000) / 1000; | ||
@@ -707,0 +707,0 @@ // plus anything further down the chain that should be rolled up in to this |
@@ -321,11 +321,15 @@ import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from "./util.js"; | ||
let zone; | ||
if (!isUndefined(matches.Z)) { | ||
zone = new FixedOffsetZone(matches.Z); | ||
} else if (!isUndefined(matches.z)) { | ||
let zone = null; | ||
let specificOffset; | ||
if (!isUndefined(matches.z)) { | ||
zone = IANAZone.create(matches.z); | ||
} else { | ||
zone = null; | ||
} | ||
if (!isUndefined(matches.Z)) { | ||
if (!zone) { | ||
zone = new FixedOffsetZone(matches.Z); | ||
} | ||
specificOffset = matches.Z; | ||
} | ||
if (!isUndefined(matches.q)) { | ||
@@ -360,3 +364,3 @@ matches.M = (matches.q - 1) * 3 + 1; | ||
return [vals, zone]; | ||
return [vals, zone, specificOffset]; | ||
} | ||
@@ -416,3 +420,5 @@ | ||
[rawMatches, matches] = match(input, regex, handlers), | ||
[result, zone] = matches ? dateTimeFromMatches(matches) : [null, null]; | ||
[result, zone, specificOffset] = matches | ||
? dateTimeFromMatches(matches) | ||
: [null, null, undefined]; | ||
if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { | ||
@@ -423,3 +429,3 @@ throw new ConflictingSpecificationError( | ||
} | ||
return { input, tokens, regex, rawMatches, matches, result, zone }; | ||
return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset }; | ||
} | ||
@@ -429,4 +435,4 @@ } | ||
export function parseFromTokens(locale, input, format) { | ||
const { result, zone, invalidReason } = explainFromTokens(locale, input, format); | ||
return [result, zone, invalidReason]; | ||
const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format); | ||
return [result, zone, specificOffset, invalidReason]; | ||
} |
@@ -12,3 +12,3 @@ import DateTime from "./datetime.js"; | ||
const VERSION = "2.1.1"; | ||
const VERSION = "2.2.0"; | ||
@@ -15,0 +15,0 @@ export { |
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3669861
40222