@internationalized/date 3.5.1-nightly.4343 → 3.5.1-nightly.4349

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -439,7 +439,7 @@ function $14e0f24ef4ac5c92$var$getRegion(locale) {
439
439
  if (!region) {
440
440
  // @ts-ignore
441
441
  region = new Intl.Locale(locale).maximize().region;
442
- $14e0f24ef4ac5c92$var$cachedRegions.set(locale, region);
442
+ if (region) $14e0f24ef4ac5c92$var$cachedRegions.set(locale, region);
443
443
  }
444
444
  return region;
445
445
  }
@@ -448,13 +448,13 @@ function $14e0f24ef4ac5c92$var$getRegion(locale) {
448
448
  // then this is a unicode extension, so ignore it.
449
449
  // Otherwise, it should be the region.
450
450
  let part = locale.split("-")[1];
451
- return part === "u" ? null : part;
451
+ return part === "u" ? undefined : part;
452
452
  }
453
453
  function $14e0f24ef4ac5c92$var$getWeekStart(locale) {
454
454
  // TODO: use Intl.Locale for this once browsers support the weekInfo property
455
455
  // https://github.com/tc39/proposal-intl-locale-info
456
456
  let region = $14e0f24ef4ac5c92$var$getRegion(locale);
457
- return (0, $2fe286d2fb449abb$export$7a5acbd77d414bd9)[region] || 0;
457
+ return region ? (0, $2fe286d2fb449abb$export$7a5acbd77d414bd9)[region] || 0 : 0;
458
458
  }
459
459
  function $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(date, locale) {
460
460
  let days = date.calendar.getDaysInMonth(date);
@@ -1225,8 +1225,8 @@ function $fae977aafc393c5c$export$ecae829bb3747ea6(value) {
1225
1225
  minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative, 0, 59),
1226
1226
  seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative, 0, 59)
1227
1227
  };
1228
- if (duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1229
- if (duration.minutes % 1 !== 0 && duration.seconds) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1228
+ 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`);
1229
+ if (duration.minutes !== undefined && duration.minutes % 1 !== 0 && duration.seconds) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1230
1230
  return duration;
1231
1231
  }
1232
1232