@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.
@@ -309,6 +309,32 @@ _dayjs.default.extend(_utc.default);
309
309
  _dayjs.default.extend(_dayjsTimezoneIanaPlugin.default);
310
310
  _dayjs.default.extend(_dayjsAbbrTimezone.default);
311
311
 
312
+ // dayjs-timezone-iana-plugin only provides instance method dayjs().tz(), not static dayjs.tz()
313
+ // Add a static wrapper function to match the API used throughout the codebase
314
+ // Check if dayjs.tz is callable as a function (it might be an object with setDefault)
315
+ const tzIsCallable = typeof _dayjs.default.tz === 'function';
316
+ if (!tzIsCallable) {
317
+ // Preserve existing properties (like setDefault) if they exist
318
+ const existingTz = _dayjs.default.tz;
319
+ const existingSetDefault = existingTz && typeof existingTz.setDefault === 'function' ? existingTz.setDefault : null;
320
+
321
+ // Create a static tz function that wraps the instance method
322
+ _dayjs.default.tz = function (date, tzName) {
323
+ if (!date) {
324
+ return (0, _dayjs.default)().tz(tzName);
325
+ }
326
+ if (_dayjs.default.isDayjs(date)) {
327
+ return date.tz(tzName);
328
+ }
329
+ return (0, _dayjs.default)(date).tz(tzName);
330
+ };
331
+
332
+ // Restore setDefault if it existed
333
+ if (existingSetDefault) {
334
+ _dayjs.default.tz.setDefault = existingSetDefault;
335
+ }
336
+ }
337
+
312
338
  // Core functionality plugins
313
339
  _dayjs.default.extend(_relativeTime.default);
314
340
  _dayjs.default.extend(_customParseFormat.default);