@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.
@@ -8284,10 +8284,48 @@ _dayjs.default.extend(_utc.default);
8284
8284
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
8285
8285
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
8286
8286
 
8287
- // Verify timezone plugin was properly extended
8288
- // This helps catch bundling issues early
8289
- if (false) // removed by dead control flow
8290
- {}
8287
+ // Verify timezone plugin was properly extended immediately after extending
8288
+ // This ensures we catch issues early and helps with webpack bundling
8289
+ const testInstance = (0, _dayjs.default)();
8290
+ if (typeof testInstance.tz !== 'function') {
8291
+ 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.');
8292
+ // Try to re-extend as a fallback (shouldn't be necessary, but helps with bundling issues)
8293
+ try {
8294
+ _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
8295
+ const retestInstance = (0, _dayjs.default)();
8296
+ if (typeof retestInstance.tz === 'function') {
8297
+ console.warn('[dayjs-timezone-iana-plugin] Plugin extension succeeded on retry.');
8298
+ }
8299
+ } catch (error) {
8300
+ console.error('[dayjs-timezone-iana-plugin] Failed to extend plugin:', error);
8301
+ }
8302
+ }
8303
+
8304
+ // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
8305
+ // Add a static wrapper function to match the API used throughout the codebase
8306
+ // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
8307
+ const tzIsCallable = typeof _dayjs.default.tz === 'function';
8308
+ if (!tzIsCallable) {
8309
+ // Preserve existing properties (like setDefault) if they exist
8310
+ const existingTz = _dayjs.default.tz;
8311
+ const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
8312
+
8313
+ // Create a static tz function that wraps the instance method
8314
+ // This wrapper ensures dayjs.tz() works even if the instance method is available
8315
+ _dayjs.default.tz = function (date, tzName) {
8316
+ // Verify instance method is available before using it
8317
+ const instance = !date ? (0, _dayjs.default)() : _dayjs.default.isDayjs(date) ? date : (0, _dayjs.default)(date);
8318
+ if (typeof instance.tz !== 'function') {
8319
+ 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.');
8320
+ }
8321
+ return instance.tz(tzName);
8322
+ };
8323
+
8324
+ // Restore setDefault if it existed
8325
+ if (existingSetDefault) {
8326
+ _dayjs.default.tz.setDefault = existingSetDefault;
8327
+ }
8328
+ }
8291
8329
 
8292
8330
  // Core functionality plugins
8293
8331
  _dayjs.default.extend(_relativeTime.default);