@timardex/cluemart-shared 1.2.98 → 1.3.0

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.
@@ -11,7 +11,7 @@ import {
11
11
  dateFormat,
12
12
  normalizeUrl,
13
13
  timeFormat
14
- } from "../chunk-TSO32GGI.mjs";
14
+ } from "../chunk-VAOS7UZI.mjs";
15
15
  import {
16
16
  EnumEventDateStatus,
17
17
  EnumEventType,
package/dist/index.cjs CHANGED
@@ -115,6 +115,7 @@ __export(index_exports, {
115
115
  tagOptions: () => tagOptions,
116
116
  testersFields: () => testersFields,
117
117
  timeFormat: () => timeFormat,
118
+ toNZTime: () => toNZTime,
118
119
  truncateText: () => truncateText,
119
120
  useAdForm: () => useAdForm,
120
121
  useAddParticipantToChat: () => useAddParticipantToChat,
@@ -621,6 +622,10 @@ import_dayjs.default.extend(import_customParseFormat.default);
621
622
  import_dayjs.default.extend(import_utc.default);
622
623
  import_dayjs.default.extend(import_timezone.default);
623
624
  import_dayjs.default.extend(import_isSameOrAfter.default);
625
+ var NZ_TZ = "Pacific/Auckland";
626
+ function toNZTime(date3) {
627
+ return (0, import_dayjs.default)(date3).tz(NZ_TZ).format();
628
+ }
624
629
  var formatDate = (dateStr, display = "datetime", timeStr) => {
625
630
  const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
626
631
  const dateTime = timeStr ? (0, import_dayjs.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs.default)(dateStr, dateFormat);
@@ -667,18 +672,25 @@ var defaultRegion = {
667
672
  longitude: 174.7450494,
668
673
  longitudeDelta: 5
669
674
  };
675
+ var isIsoDateString = (value) => {
676
+ return typeof value === "string" && !isNaN(Date.parse(value));
677
+ };
670
678
  var removeTypename = (obj) => {
679
+ if (obj instanceof Date) {
680
+ return obj;
681
+ }
682
+ if (isIsoDateString(obj)) {
683
+ return obj;
684
+ }
671
685
  if (Array.isArray(obj)) {
672
- return obj.map((item) => removeTypename(item));
673
- } else if (obj !== null && typeof obj === "object") {
686
+ return obj.map(removeTypename);
687
+ }
688
+ if (obj !== null && typeof obj === "object") {
674
689
  const { __typename, ...cleanedObj } = obj;
675
- return Object.keys(cleanedObj).reduce(
676
- (acc, key) => {
677
- acc[key] = removeTypename(cleanedObj[key]);
678
- return acc;
679
- },
680
- {}
681
- );
690
+ return Object.keys(cleanedObj).reduce((acc, key) => {
691
+ acc[key] = removeTypename(cleanedObj[key]);
692
+ return acc;
693
+ }, {});
682
694
  }
683
695
  return obj;
684
696
  };
@@ -7121,6 +7133,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
7121
7133
  tagOptions,
7122
7134
  testersFields,
7123
7135
  timeFormat,
7136
+ toNZTime,
7124
7137
  truncateText,
7125
7138
  useAdForm,
7126
7139
  useAddParticipantToChat,