@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260418061226 → 0.8.1-dev.20260418062449

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
@@ -1185,28 +1185,32 @@ var DateView = (props) => {
1185
1185
  const parsedDate = new Date(
1186
1186
  dateString.includes("Z") ? dateString : dateString + "Z"
1187
1187
  );
1188
+ const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
1188
1189
  if (format === "relative") {
1189
1190
  return getRelativeTime(dateString);
1190
1191
  }
1191
1192
  switch (props.controlType) {
1192
1193
  case "date":
1193
1194
  return new Intl.DateTimeFormat("en", {
1195
+ timeZone: userTimeZone,
1194
1196
  day: "2-digit",
1195
1197
  month: "short",
1196
1198
  year: "numeric"
1197
1199
  }).format(parsedDate);
1198
1200
  case "time":
1199
1201
  return `${formatTime(parsedDate)} ${getTimeZoneAbbreviation(
1200
- Intl.DateTimeFormat().resolvedOptions().timeZone
1202
+ userTimeZone
1201
1203
  )} (${getTimePeriod(parsedDate)})`;
1202
1204
  default:
1203
1205
  return parsedDate.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
1206
+ timeZone: userTimeZone,
1204
1207
  day: "2-digit",
1205
1208
  month: "short",
1206
1209
  year: "numeric",
1207
1210
  hour: "2-digit",
1208
1211
  minute: "2-digit"
1209
1212
  }).format(parsedDate) : new Intl.DateTimeFormat("en", {
1213
+ timeZone: userTimeZone,
1210
1214
  day: "2-digit",
1211
1215
  month: "short",
1212
1216
  year: "numeric",
@@ -1217,7 +1221,17 @@ var DateView = (props) => {
1217
1221
  }
1218
1222
  };
1219
1223
  const formatTime = (date) => {
1220
- return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", { hour: "2-digit", minute: "2-digit" }).format(date) : new Intl.DateTimeFormat("en", { hour: "2-digit", minute: "2-digit", second: "2-digit" }).format(date);
1224
+ const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
1225
+ return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
1226
+ timeZone: userTimeZone,
1227
+ hour: "2-digit",
1228
+ minute: "2-digit"
1229
+ }).format(date) : new Intl.DateTimeFormat("en", {
1230
+ timeZone: userTimeZone,
1231
+ hour: "2-digit",
1232
+ minute: "2-digit",
1233
+ second: "2-digit"
1234
+ }).format(date);
1221
1235
  };
1222
1236
  const getTimePeriod = (date) => {
1223
1237
  const hours = date.getHours();
package/dist/index.mjs CHANGED
@@ -197,28 +197,32 @@ var DateView = (props) => {
197
197
  const parsedDate = new Date(
198
198
  dateString.includes("Z") ? dateString : dateString + "Z"
199
199
  );
200
+ const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
200
201
  if (format === "relative") {
201
202
  return getRelativeTime(dateString);
202
203
  }
203
204
  switch (props.controlType) {
204
205
  case "date":
205
206
  return new Intl.DateTimeFormat("en", {
207
+ timeZone: userTimeZone,
206
208
  day: "2-digit",
207
209
  month: "short",
208
210
  year: "numeric"
209
211
  }).format(parsedDate);
210
212
  case "time":
211
213
  return `${formatTime(parsedDate)} ${getTimeZoneAbbreviation(
212
- Intl.DateTimeFormat().resolvedOptions().timeZone
214
+ userTimeZone
213
215
  )} (${getTimePeriod(parsedDate)})`;
214
216
  default:
215
217
  return parsedDate.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
218
+ timeZone: userTimeZone,
216
219
  day: "2-digit",
217
220
  month: "short",
218
221
  year: "numeric",
219
222
  hour: "2-digit",
220
223
  minute: "2-digit"
221
224
  }).format(parsedDate) : new Intl.DateTimeFormat("en", {
225
+ timeZone: userTimeZone,
222
226
  day: "2-digit",
223
227
  month: "short",
224
228
  year: "numeric",
@@ -229,7 +233,17 @@ var DateView = (props) => {
229
233
  }
230
234
  };
231
235
  const formatTime = (date) => {
232
- return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", { hour: "2-digit", minute: "2-digit" }).format(date) : new Intl.DateTimeFormat("en", { hour: "2-digit", minute: "2-digit", second: "2-digit" }).format(date);
236
+ const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
237
+ return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
238
+ timeZone: userTimeZone,
239
+ hour: "2-digit",
240
+ minute: "2-digit"
241
+ }).format(date) : new Intl.DateTimeFormat("en", {
242
+ timeZone: userTimeZone,
243
+ hour: "2-digit",
244
+ minute: "2-digit",
245
+ second: "2-digit"
246
+ }).format(date);
233
247
  };
234
248
  const getTimePeriod = (date) => {
235
249
  const hours = date.getHours();
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.20260418061226",
3
+ "version": "0.8.1-dev.20260418062449",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",