@internationalized/date
Advanced tools
Comparing version 3.0.0-nightly-ab9fd5c68-241126 to 3.0.0-nightly-adae13c78-241218
@@ -142,7 +142,7 @@ var $625ad1e1f4c43bc1$exports = require("./CalendarDate.main.js"); | ||
if (!match) throw new Error(`Invalid ISO 8601 Duration string: ${value}`); | ||
const parseDurationGroup = (group, isNegative, min, max)=>{ | ||
const parseDurationGroup = (group, isNegative)=>{ | ||
if (!group) return 0; | ||
try { | ||
const sign = isNegative ? -1 : 1; | ||
return sign * $4c32e2d98e5a5134$var$parseNumber(group.replace(',', '.'), min, max); | ||
return sign * Number(group.replace(',', '.')); | ||
} catch { | ||
@@ -167,9 +167,9 @@ throw new Error(`Invalid ISO 8601 Duration string: ${value}`); | ||
const duration = { | ||
years: parseDurationGroup((_match_groups2 = match.groups) === null || _match_groups2 === void 0 ? void 0 : _match_groups2.years, isNegative, 0, 9999), | ||
months: parseDurationGroup((_match_groups3 = match.groups) === null || _match_groups3 === void 0 ? void 0 : _match_groups3.months, isNegative, 0, 12), | ||
weeks: parseDurationGroup((_match_groups4 = match.groups) === null || _match_groups4 === void 0 ? void 0 : _match_groups4.weeks, isNegative, 0, Infinity), | ||
days: parseDurationGroup((_match_groups5 = match.groups) === null || _match_groups5 === void 0 ? void 0 : _match_groups5.days, isNegative, 0, 31), | ||
hours: parseDurationGroup((_match_groups6 = match.groups) === null || _match_groups6 === void 0 ? void 0 : _match_groups6.hours, isNegative, 0, 23), | ||
minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative, 0, 59), | ||
seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative, 0, 59) | ||
years: parseDurationGroup((_match_groups2 = match.groups) === null || _match_groups2 === void 0 ? void 0 : _match_groups2.years, isNegative), | ||
months: parseDurationGroup((_match_groups3 = match.groups) === null || _match_groups3 === void 0 ? void 0 : _match_groups3.months, isNegative), | ||
weeks: parseDurationGroup((_match_groups4 = match.groups) === null || _match_groups4 === void 0 ? void 0 : _match_groups4.weeks, isNegative), | ||
days: parseDurationGroup((_match_groups5 = match.groups) === null || _match_groups5 === void 0 ? void 0 : _match_groups5.days, isNegative), | ||
hours: parseDurationGroup((_match_groups6 = match.groups) === null || _match_groups6 === void 0 ? void 0 : _match_groups6.hours, isNegative), | ||
minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative), | ||
seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative) | ||
}; | ||
@@ -176,0 +176,0 @@ if (duration.hours !== undefined && duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`); |
@@ -126,7 +126,7 @@ import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from "./CalendarDate.module.js"; | ||
if (!match) throw new Error(`Invalid ISO 8601 Duration string: ${value}`); | ||
const parseDurationGroup = (group, isNegative, min, max)=>{ | ||
const parseDurationGroup = (group, isNegative)=>{ | ||
if (!group) return 0; | ||
try { | ||
const sign = isNegative ? -1 : 1; | ||
return sign * $fae977aafc393c5c$var$parseNumber(group.replace(',', '.'), min, max); | ||
return sign * Number(group.replace(',', '.')); | ||
} catch { | ||
@@ -151,9 +151,9 @@ throw new Error(`Invalid ISO 8601 Duration string: ${value}`); | ||
const duration = { | ||
years: parseDurationGroup((_match_groups2 = match.groups) === null || _match_groups2 === void 0 ? void 0 : _match_groups2.years, isNegative, 0, 9999), | ||
months: parseDurationGroup((_match_groups3 = match.groups) === null || _match_groups3 === void 0 ? void 0 : _match_groups3.months, isNegative, 0, 12), | ||
weeks: parseDurationGroup((_match_groups4 = match.groups) === null || _match_groups4 === void 0 ? void 0 : _match_groups4.weeks, isNegative, 0, Infinity), | ||
days: parseDurationGroup((_match_groups5 = match.groups) === null || _match_groups5 === void 0 ? void 0 : _match_groups5.days, isNegative, 0, 31), | ||
hours: parseDurationGroup((_match_groups6 = match.groups) === null || _match_groups6 === void 0 ? void 0 : _match_groups6.hours, isNegative, 0, 23), | ||
minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative, 0, 59), | ||
seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative, 0, 59) | ||
years: parseDurationGroup((_match_groups2 = match.groups) === null || _match_groups2 === void 0 ? void 0 : _match_groups2.years, isNegative), | ||
months: parseDurationGroup((_match_groups3 = match.groups) === null || _match_groups3 === void 0 ? void 0 : _match_groups3.months, isNegative), | ||
weeks: parseDurationGroup((_match_groups4 = match.groups) === null || _match_groups4 === void 0 ? void 0 : _match_groups4.weeks, isNegative), | ||
days: parseDurationGroup((_match_groups5 = match.groups) === null || _match_groups5 === void 0 ? void 0 : _match_groups5.days, isNegative), | ||
hours: parseDurationGroup((_match_groups6 = match.groups) === null || _match_groups6 === void 0 ? void 0 : _match_groups6.hours, isNegative), | ||
minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative), | ||
seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative) | ||
}; | ||
@@ -160,0 +160,0 @@ if (duration.hours !== undefined && duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`); |
{ | ||
"name": "@internationalized/date", | ||
"version": "3.0.0-nightly-ab9fd5c68-241126", | ||
"version": "3.0.0-nightly-adae13c78-241218", | ||
"description": "Internationalized calendar, date, and time manipulation utilities", | ||
@@ -29,4 +29,3 @@ "license": "Apache-2.0", | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.6.0" | ||
} | ||
} |
@@ -237,5 +237,3 @@ /* | ||
group: string | undefined, | ||
isNegative: boolean, | ||
min: number, | ||
max: number | ||
isNegative: boolean | ||
): number => { | ||
@@ -247,3 +245,3 @@ if (!group) { | ||
const sign = isNegative ? -1 : 1; | ||
return sign * parseNumber(group.replace(',', '.'), min, max); | ||
return sign * Number(group.replace(',', '.')); | ||
} catch { | ||
@@ -272,9 +270,9 @@ throw new Error(`Invalid ISO 8601 Duration string: ${value}`); | ||
const duration: Mutable<DateTimeDuration> = { | ||
years: parseDurationGroup(match.groups?.years, isNegative, 0, 9999), | ||
months: parseDurationGroup(match.groups?.months, isNegative, 0, 12), | ||
weeks: parseDurationGroup(match.groups?.weeks, isNegative, 0, Infinity), | ||
days: parseDurationGroup(match.groups?.days, isNegative, 0, 31), | ||
hours: parseDurationGroup(match.groups?.hours, isNegative, 0, 23), | ||
minutes: parseDurationGroup(match.groups?.minutes, isNegative, 0, 59), | ||
seconds: parseDurationGroup(match.groups?.seconds, isNegative, 0, 59) | ||
years: parseDurationGroup(match.groups?.years, isNegative), | ||
months: parseDurationGroup(match.groups?.months, isNegative), | ||
weeks: parseDurationGroup(match.groups?.weeks, isNegative), | ||
days: parseDurationGroup(match.groups?.days, isNegative), | ||
hours: parseDurationGroup(match.groups?.hours, isNegative), | ||
minutes: parseDurationGroup(match.groups?.minutes, isNegative), | ||
seconds: parseDurationGroup(match.groups?.seconds, isNegative) | ||
}; | ||
@@ -281,0 +279,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
987684
11863