diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap
index d55323c..aff1803 100644
--- a/src/components/App/__snapshots__/App.test.js.snap
+++ b/src/components/App/__snapshots__/App.test.js.snap
@@ -2857,7 +2857,7 @@ exports[`App Route /issue-info authenticated 1`] = `
Created
:
- 12/9/2022 11:16:38 PM
+ 12/09/2022 23:16:38+00:00
- 7/1/2021 10:40:07 PM
+ 07/01/2021 22:40:07+00:00
- 7/12/2021 6:22:13 PM
+ 07/12/2021 18:22:13+00:00
|
- 7/1/2021 10:40:07 PM
+ 07/01/2021 22:40:07+00:00
|
- 7/12/2021 6:22:13 PM
+ 07/12/2021 18:22:13+00:00
|
- 7/1/2021 10:40:07 PM
+ 07/01/2021 22:40:07+00:00
|
- 7/12/2021 6:22:13 PM
+ 07/12/2021 18:22:13+00:00
|
@@ -7190,12 +7190,12 @@ exports[`App Route /packages authenticated 1`] = `
- 7/1/2021 10:40:07 PM
+ 07/01/2021 22:40:07+00:00
|
- 7/12/2021 6:22:13 PM
+ 07/12/2021 18:22:13+00:00
|
- 1/13/2023 2:11:33 AM
+ 01/13/2023 02:11:33+00:00
|
- 1/13/2023 2:11:33 AM
+ 01/13/2023 02:11:33+00:00
diff --git a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap
index 7865d21..0a9f5cc 100644
--- a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap
+++ b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap
@@ -212,7 +212,7 @@ exports[`DigitalTwinTab Render 1`] = `
Updated At
:
- 7/26/2022 12:26:38 AM
+ 07/26/2022 00:26:38+00:00
- 7/14/2021 8:09:40 PM
+ 07/14/2021 20:09:40+00:00
- 7/14/2021 8:09:40 PM
+ 07/14/2021 20:09:40+00:00
|
{
const expectedSignalsData = [
{
- timestamp: "7/14/2021 8:09:40 PM",
+ timestamp: "07/14/2021 20:09:40+00:00",
signal: "signal",
value: 123
},
diff --git a/src/components/Controls/CarUpdateStatusTable/__snapshots__/CarUpdateStatusTable.test.jsx.snap b/src/components/Controls/CarUpdateStatusTable/__snapshots__/CarUpdateStatusTable.test.jsx.snap
index 1e588b0..03ac0f1 100644
--- a/src/components/Controls/CarUpdateStatusTable/__snapshots__/CarUpdateStatusTable.test.jsx.snap
+++ b/src/components/Controls/CarUpdateStatusTable/__snapshots__/CarUpdateStatusTable.test.jsx.snap
@@ -117,7 +117,7 @@ exports[`CarUpdateStatusTable Render 1`] = `
|
- 8/23/2021 5:06:38 PM
+ 08/23/2021 17:06:38+00:00
|
- 8/23/2021 5:06:38 PM
+ 08/23/2021 17:06:38+00:00
|
- 8/23/2021 5:06:38 PM
+ 08/23/2021 17:06:38+00:00
|
- 8/23/2021 5:06:38 PM
+ 08/23/2021 17:06:38+00:00
|
- 8/23/2021 5:06:38 PM
+ 08/23/2021 17:06:38+00:00
|
{
{getFilteredLogs(logs).slice(-getDesiredSize(), (pageIndex === 0 ? undefined : -(pageSize * pageIndex))).reverse().map((log, i) => (
{log.level}
- {log.trex_timestamp}
- {log.cloud_timestamp}
+ {LocalDateTimeString(log.trex_timestamp)}
+ {LocalDateTimeString(log.cloud_timestamp)}
{log.line_number}
{log.filename}
{log.msg}
diff --git a/src/components/Suppliers/List/__snapshots__/index.test.jsx.snap b/src/components/Suppliers/List/__snapshots__/index.test.jsx.snap
index 7691935..068bbbd 100644
--- a/src/components/Suppliers/List/__snapshots__/index.test.jsx.snap
+++ b/src/components/Suppliers/List/__snapshots__/index.test.jsx.snap
@@ -285,7 +285,7 @@ exports[`Suppliers page Render 1`] = `
|
- 7/14/2021 8:09:40 PM
+ 07/14/2021 20:09:40+00:00
|
- 7/16/2021 10:09:40 PM
+ 07/16/2021 22:09:40+00:00
|
- 7/16/2021 10:09:40 PM
+ 07/16/2021 22:09:40+00:00
|
{
export const LocalDateTimeString = (datestring) => {
if (!datestring) return "";
- const date = new Date(datestring.replace(" ", "T"));
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
+
+ // adapted from https://www.30secondsofcode.org/js/s/iso-format-date-with-timezone/
+
+ // Pad a number to 2 digits
+ const pad = n => `${Math.floor(Math.abs(n))}`.padStart(2, '0');
+
+ // Get timezone offset in ISO format (+hh:mm or -hh:mm)
+ const getTzOffset = date => {
+ const tzOffset = -date.getTimezoneOffset();
+ const diff = tzOffset >= 0 ? '+' : '-';
+ return diff + pad(tzOffset / 60) + ':' + pad(tzOffset % 60);
+ };
+
+ const toISOStringWithTimezone = date => {
+ return pad(date.getMonth() + 1) +
+ '/' + pad(date.getDate()) +
+ '/' + pad(date.getFullYear()) +
+ ' ' + pad(date.getHours()) +
+ ':' + pad(date.getMinutes()) +
+ ':' + pad(date.getSeconds()) +
+ getTzOffset(date);
+ };
+
+ return toISOStringWithTimezone(
+ new Date(datestring.replace(" ", "T"))
+ );
};
| |