Comparing version 1.22.2 to 1.23.0
# Changelog | ||
## 1.23.0 | ||
* Allow minus sign prefix when creating Duration from ISO | ||
# 1.22.2 | ||
* Added more details to error messages for type errors | ||
# 1.22.1 | ||
* Added support for ISO basic format to DateTime#toISO | ||
## 1.22.0 | ||
@@ -4,0 +16,0 @@ |
{ | ||
"name": "luxon", | ||
"version": "1.22.2", | ||
"version": "1.23.0", | ||
"description": "Immutable date wrapper", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Cambron", |
@@ -123,7 +123,7 @@ import { | ||
const isoDuration = /^P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/; | ||
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/; | ||
function extractISODuration(match) { | ||
const [ | ||
, | ||
s, | ||
yearStr, | ||
@@ -139,12 +139,16 @@ monthStr, | ||
const hasNegativePrefix = s[0] === "-"; | ||
const maybeNegate = num => (num && hasNegativePrefix ? -num : num); | ||
return [ | ||
{ | ||
years: parseInteger(yearStr), | ||
months: parseInteger(monthStr), | ||
weeks: parseInteger(weekStr), | ||
days: parseInteger(dayStr), | ||
hours: parseInteger(hourStr), | ||
minutes: parseInteger(minuteStr), | ||
seconds: parseInteger(secondStr), | ||
milliseconds: parseMillis(millisecondsStr) | ||
years: maybeNegate(parseInteger(yearStr)), | ||
months: maybeNegate(parseInteger(monthStr)), | ||
weeks: maybeNegate(parseInteger(weekStr)), | ||
days: maybeNegate(parseInteger(dayStr)), | ||
hours: maybeNegate(parseInteger(hourStr)), | ||
minutes: maybeNegate(parseInteger(minuteStr)), | ||
seconds: maybeNegate(parseInteger(secondStr)), | ||
milliseconds: maybeNegate(parseMillis(millisecondsStr)) | ||
} | ||
@@ -151,0 +155,0 @@ ]; |
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
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
2969773
33939