@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260428094243 → 0.8.1-dev.20260428110702

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.
package/dist/index.js CHANGED
@@ -1300,9 +1300,15 @@ var DateView = (props) => {
1300
1300
  const getTimeZoneAbbreviation = (timeZone) => {
1301
1301
  return timeZoneAbbreviations[timeZone] || timeZone;
1302
1302
  };
1303
+ const toUtcDate = (dateString) => {
1304
+ const s = dateString.trim();
1305
+ const iso = s.replace(" ", "T");
1306
+ const utc = iso.endsWith("Z") || iso.includes("+") ? iso : iso + "Z";
1307
+ return new Date(utc);
1308
+ };
1303
1309
  const getRelativeTime = (dateString) => {
1304
1310
  const now = /* @__PURE__ */ new Date();
1305
- const date = /* @__PURE__ */ new Date(dateString + "Z");
1311
+ const date = toUtcDate(dateString);
1306
1312
  const diffMs = now.getTime() - date.getTime();
1307
1313
  const diffSec = Math.floor(diffMs / 1e3);
1308
1314
  const diffMin = Math.floor(diffSec / 60);
@@ -1319,9 +1325,8 @@ var DateView = (props) => {
1319
1325
  timeZone: userTimeZone
1320
1326
  }).format(date);
1321
1327
  };
1322
- console.log("DateView props:", props);
1323
1328
  const parseAndFormatDate = (dateString, format) => {
1324
- const parsedDate = /* @__PURE__ */ new Date(dateString + "Z");
1329
+ const parsedDate = toUtcDate(dateString);
1325
1330
  if (format === "relative") {
1326
1331
  return getRelativeTime(dateString);
1327
1332
  }
package/dist/index.mjs CHANGED
@@ -168,9 +168,15 @@ var DateView = (props) => {
168
168
  const getTimeZoneAbbreviation = (timeZone) => {
169
169
  return timeZoneAbbreviations[timeZone] || timeZone;
170
170
  };
171
+ const toUtcDate = (dateString) => {
172
+ const s = dateString.trim();
173
+ const iso = s.replace(" ", "T");
174
+ const utc = iso.endsWith("Z") || iso.includes("+") ? iso : iso + "Z";
175
+ return new Date(utc);
176
+ };
171
177
  const getRelativeTime = (dateString) => {
172
178
  const now = /* @__PURE__ */ new Date();
173
- const date = /* @__PURE__ */ new Date(dateString + "Z");
179
+ const date = toUtcDate(dateString);
174
180
  const diffMs = now.getTime() - date.getTime();
175
181
  const diffSec = Math.floor(diffMs / 1e3);
176
182
  const diffMin = Math.floor(diffSec / 60);
@@ -187,9 +193,8 @@ var DateView = (props) => {
187
193
  timeZone: userTimeZone
188
194
  }).format(date);
189
195
  };
190
- console.log("DateView props:", props);
191
196
  const parseAndFormatDate = (dateString, format) => {
192
- const parsedDate = /* @__PURE__ */ new Date(dateString + "Z");
197
+ const parsedDate = toUtcDate(dateString);
193
198
  if (format === "relative") {
194
199
  return getRelativeTime(dateString);
195
200
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260428094243",
3
+ "version": "0.8.1-dev.20260428110702",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",