@capillarytech/blaze-ui 4.33.8 → 4.33.9

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.
@@ -3874,10 +3874,48 @@ _dayjs.default.extend(_utc.default);
3874
3874
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
3875
3875
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
3876
3876
 
3877
- // Verify timezone plugin was properly extended
3878
- // This helps catch bundling issues early
3879
- if (false) // removed by dead control flow
3880
- {}
3877
+ // Verify timezone plugin was properly extended immediately after extending
3878
+ // This ensures we catch issues early and helps with webpack bundling
3879
+ const testInstance = (0, _dayjs.default)();
3880
+ if (typeof testInstance.tz !== 'function') {
3881
+ 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.');
3882
+ // Try to re-extend as a fallback (shouldn't be necessary, but helps with bundling issues)
3883
+ try {
3884
+ _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
3885
+ const retestInstance = (0, _dayjs.default)();
3886
+ if (typeof retestInstance.tz === 'function') {
3887
+ console.warn('[dayjs-timezone-iana-plugin] Plugin extension succeeded on retry.');
3888
+ }
3889
+ } catch (error) {
3890
+ console.error('[dayjs-timezone-iana-plugin] Failed to extend plugin:', error);
3891
+ }
3892
+ }
3893
+
3894
+ // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
3895
+ // Add a static wrapper function to match the API used throughout the codebase
3896
+ // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
3897
+ const tzIsCallable = typeof _dayjs.default.tz === 'function';
3898
+ if (!tzIsCallable) {
3899
+ // Preserve existing properties (like setDefault) if they exist
3900
+ const existingTz = _dayjs.default.tz;
3901
+ const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
3902
+
3903
+ // Create a static tz function that wraps the instance method
3904
+ // This wrapper ensures dayjs.tz() works even if the instance method is available
3905
+ _dayjs.default.tz = function (date, tzName) {
3906
+ // Verify instance method is available before using it
3907
+ const instance = !date ? (0, _dayjs.default)() : _dayjs.default.isDayjs(date) ? date : (0, _dayjs.default)(date);
3908
+ if (typeof instance.tz !== 'function') {
3909
+ 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.');
3910
+ }
3911
+ return instance.tz(tzName);
3912
+ };
3913
+
3914
+ // Restore setDefault if it existed
3915
+ if (existingSetDefault) {
3916
+ _dayjs.default.tz.setDefault = existingSetDefault;
3917
+ }
3918
+ }
3881
3919
 
3882
3920
  // Core functionality plugins
3883
3921
  _dayjs.default.extend(_relativeTime.default);