From a53d01e6d73ca859a69f7c0e06c329476601c4fc Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 18 Jan 2023 12:55:01 +0100 Subject: [PATCH 1/8] display time in the user's local time for pretty mode --- .../DatasetInformation/DatasetInformation.test.js | 5 ++--- client/src/components/UtcDate.vue | 8 +++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/client/src/components/DatasetInformation/DatasetInformation.test.js b/client/src/components/DatasetInformation/DatasetInformation.test.js index 84ef036a4786..897f79474ade 100644 --- a/client/src/components/DatasetInformation/DatasetInformation.test.js +++ b/client/src/components/DatasetInformation/DatasetInformation.test.js @@ -5,8 +5,7 @@ import { getLocalVue } from "tests/jest/helpers"; import DatasetInformation from "./DatasetInformation"; import datasetResponse from "./testData/datasetResponse"; import flushPromises from "flush-promises"; -import { parseISO } from "date-fns"; -import { formatInTimeZone } from "date-fns-tz"; +import { format, parseISO } from "date-fns"; const HDA_ID = "FOO_HDA_ID"; @@ -67,7 +66,7 @@ describe("DatasetInformation/DatasetInformation", () => { it("Date should be formatted", async () => { const date = datasetInfoTable.find(".utc-time").text(); const parsedDate = parseISO(`${datasetResponse.create_time}Z`); - const formattedDate = `${formatInTimeZone(parsedDate, "Etc/Zulu", "eeee MMM do H:mm:ss yyyy")} UTC`; + const formattedDate = `${format(parsedDate, "eeee MMM do H:mm:ss yyyy zz")}`; expect(date).toBe(formattedDate); }); diff --git a/client/src/components/UtcDate.vue b/client/src/components/UtcDate.vue index dbbc20baca61..097e08041696 100644 --- a/client/src/components/UtcDate.vue +++ b/client/src/components/UtcDate.vue @@ -1,7 +1,6 @@ +