Comparing version 3.1.0 to 3.1.1
{ | ||
"name": "luxon", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Immutable date wrapper", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Cambron", |
@@ -6,3 +6,2 @@ import { | ||
parseMillis, | ||
ianaRegex, | ||
isUndefined, | ||
@@ -25,2 +24,4 @@ parseFloating, | ||
const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; | ||
function combineRegexes(...regexes) { | ||
@@ -27,0 +28,0 @@ const full = regexes.reduce((f, r) => f + r.source, ""); |
@@ -8,2 +8,3 @@ /* | ||
import { InvalidArgumentError } from "../errors.js"; | ||
import Settings from "../settings.js"; | ||
@@ -189,3 +190,3 @@ /** | ||
return year; | ||
} else return year > 60 ? 1900 + year : 2000 + year; | ||
} else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; | ||
} | ||
@@ -273,4 +274,1 @@ | ||
} | ||
export const ianaRegex = | ||
/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; |
@@ -12,3 +12,3 @@ import DateTime from "./datetime.js"; | ||
const VERSION = "3.1.0"; | ||
const VERSION = "3.1.1"; | ||
@@ -15,0 +15,0 @@ export { |
@@ -12,2 +12,3 @@ import SystemZone from "./zones/systemZone.js"; | ||
defaultOutputCalendar = null, | ||
twoDigitCutoffYear = 60, | ||
throwOnInvalid; | ||
@@ -105,2 +106,22 @@ | ||
/** | ||
* Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. | ||
* @type {number} | ||
*/ | ||
static get twoDigitCutoffYear() { | ||
return twoDigitCutoffYear; | ||
} | ||
/** | ||
* Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. | ||
* @type {number} | ||
* @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpretted as current century | ||
* @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 | ||
* @example Settings.twoDigitCutoffYear = 1950 // interpretted as 50 | ||
* @example Settings.twoDigitCutoffYear = 2050 // ALSO interpretted as 50 | ||
*/ | ||
static set twoDigitCutoffYear(cutoffYear) { | ||
twoDigitCutoffYear = cutoffYear % 100; | ||
} | ||
/** | ||
* Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals | ||
@@ -107,0 +128,0 @@ * @type {boolean} |
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
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
3927620
41631