@capillarytech/blaze-ui 4.33.9 → 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,23 +543,6 @@ _dayjs.default.extend(_utc.default);
543
543
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
544
544
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
545
545
 
546
- // Verify timezone plugin was properly extended immediately after extending
547
- // This ensures we catch issues early and helps with webpack bundling
548
- const testInstance = (0, _dayjs.default)();
549
- if (typeof testInstance.tz !== 'function') {
550
- console.error('[dayjs-timezone-iana-plugin] CRITICAL: Plugin not properly extended!', 'dayjs().tz type:', typeof testInstance.tz, 'This indicates the plugin extension failed. Check plugin import and order.');
551
- // Try to re-extend as a fallback (shouldn't be necessary, but helps with bundling issues)
552
- try {
553
- _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
554
- const retestInstance = (0, _dayjs.default)();
555
- if (typeof retestInstance.tz === 'function') {
556
- console.warn('[dayjs-timezone-iana-plugin] Plugin extension succeeded on retry.');
557
- }
558
- } catch (error) {
559
- console.error('[dayjs-timezone-iana-plugin] Failed to extend plugin:', error);
560
- }
561
- }
562
-
563
546
  // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
564
547
  // Add a static wrapper function to match the API used throughout the codebase
565
548
  // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
@@ -570,14 +553,14 @@ if (!tzIsCallable) {
570
553
  const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
571
554
 
572
555
  // Create a static tz function that wraps the instance method
573
- // This wrapper ensures dayjs.tz() works even if the instance method is available
574
556
  _dayjs.default.tz = function (date, tzName) {
575
- // Verify instance method is available before using it
576
- const instance = !date ? (0, _dayjs.default)() : _dayjs.default.isDayjs(date) ? date : (0, _dayjs.default)(date);
577
- if (typeof instance.tz !== 'function') {
578
- throw new Error('dayjs().tz() is not available. The timezone plugin may not be properly extended. ' + 'Check that dayjs-timezone-iana-plugin is correctly imported and extended.');
557
+ if (!date) {
558
+ return (0, _dayjs.default)().tz(tzName);
559
+ }
560
+ if (_dayjs.default.isDayjs(date)) {
561
+ return date.tz(tzName);
579
562
  }
580
- return instance.tz(tzName);
563
+ return (0, _dayjs.default)(date).tz(tzName);
581
564
  };
582
565
 
583
566
  // Restore setDefault if it existed