@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.
@@ -3822,10 +3822,48 @@ _dayjs.default.extend(_utc.default);
3822
3822
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
3823
3823
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
3824
3824
 
3825
- // Verify timezone plugin was properly extended
3826
- // This helps catch bundling issues early
3827
- if (false) // removed by dead control flow
3828
- {}
3825
+ // Verify timezone plugin was properly extended immediately after extending
3826
+ // This ensures we catch issues early and helps with webpack bundling
3827
+ const testInstance = (0, _dayjs.default)();
3828
+ if (typeof testInstance.tz !== 'function') {
3829
+ 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.');
3830
+ // Try to re-extend as a fallback (shouldn't be necessary, but helps with bundling issues)
3831
+ try {
3832
+ _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
3833
+ const retestInstance = (0, _dayjs.default)();
3834
+ if (typeof retestInstance.tz === 'function') {
3835
+ console.warn('[dayjs-timezone-iana-plugin] Plugin extension succeeded on retry.');
3836
+ }
3837
+ } catch (error) {
3838
+ console.error('[dayjs-timezone-iana-plugin] Failed to extend plugin:', error);
3839
+ }
3840
+ }
3841
+
3842
+ // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
3843
+ // Add a static wrapper function to match the API used throughout the codebase
3844
+ // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
3845
+ const tzIsCallable = typeof _dayjs.default.tz === 'function';
3846
+ if (!tzIsCallable) {
3847
+ // Preserve existing properties (like setDefault) if they exist
3848
+ const existingTz = _dayjs.default.tz;
3849
+ const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
3850
+
3851
+ // Create a static tz function that wraps the instance method
3852
+ // This wrapper ensures dayjs.tz() works even if the instance method is available
3853
+ _dayjs.default.tz = function (date, tzName) {
3854
+ // Verify instance method is available before using it
3855
+ const instance = !date ? (0, _dayjs.default)() : _dayjs.default.isDayjs(date) ? date : (0, _dayjs.default)(date);
3856
+ if (typeof instance.tz !== 'function') {
3857
+ 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.');
3858
+ }
3859
+ return instance.tz(tzName);
3860
+ };
3861
+
3862
+ // Restore setDefault if it existed
3863
+ if (existingSetDefault) {
3864
+ _dayjs.default.tz.setDefault = existingSetDefault;
3865
+ }
3866
+ }
3829
3867
 
3830
3868
  // Core functionality plugins
3831
3869
  _dayjs.default.extend(_relativeTime.default);