@capillarytech/blaze-ui 4.33.10 → 4.33.11

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.
@@ -543,6 +543,32 @@ _dayjs.default.extend(_utc.default);
543
543
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
544
544
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
545
545
 
546
+ // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
547
+ // Add a static wrapper function to match the API used throughout the codebase
548
+ // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
549
+ const tzIsCallable = typeof _dayjs.default.tz === 'function';
550
+ if (!tzIsCallable) {
551
+ // Preserve existing properties (like setDefault) if they exist
552
+ const existingTz = _dayjs.default.tz;
553
+ const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
554
+
555
+ // Create a static tz function that wraps the instance method
556
+ _dayjs.default.tz = function (date, tzName) {
557
+ if (!date) {
558
+ return (0, _dayjs.default)().tz(tzName);
559
+ }
560
+ if (_dayjs.default.isDayjs(date)) {
561
+ return date.tz(tzName);
562
+ }
563
+ return (0, _dayjs.default)(date).tz(tzName);
564
+ };
565
+
566
+ // Restore setDefault if it existed
567
+ if (existingSetDefault) {
568
+ _dayjs.default.tz.setDefault = existingSetDefault;
569
+ }
570
+ }
571
+
546
572
  // Core functionality plugins
547
573
  _dayjs.default.extend(_relativeTime.default);
548
574
  _dayjs.default.extend(_customParseFormat.default);