@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.
@@ -4125,6 +4125,32 @@ _dayjs.default.extend(_utc.default);
4125
4125
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
4126
4126
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
4127
4127
 
4128
+ // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
4129
+ // Add a static wrapper function to match the API used throughout the codebase
4130
+ // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
4131
+ const tzIsCallable = typeof _dayjs.default.tz === 'function';
4132
+ if (!tzIsCallable) {
4133
+ // Preserve existing properties (like setDefault) if they exist
4134
+ const existingTz = _dayjs.default.tz;
4135
+ const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
4136
+
4137
+ // Create a static tz function that wraps the instance method
4138
+ _dayjs.default.tz = function (date, tzName) {
4139
+ if (!date) {
4140
+ return (0, _dayjs.default)().tz(tzName);
4141
+ }
4142
+ if (_dayjs.default.isDayjs(date)) {
4143
+ return date.tz(tzName);
4144
+ }
4145
+ return (0, _dayjs.default)(date).tz(tzName);
4146
+ };
4147
+
4148
+ // Restore setDefault if it existed
4149
+ if (existingSetDefault) {
4150
+ _dayjs.default.tz.setDefault = existingSetDefault;
4151
+ }
4152
+ }
4153
+
4128
4154
  // Core functionality plugins
4129
4155
  _dayjs.default.extend(_relativeTime.default);
4130
4156
  _dayjs.default.extend(_customParseFormat.default);