Loading client/package.json +0 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ "d3-zoom": "^3.0.0", "d3v3": "npm:d3@3", "date-fns": "^2.28.0", "date-fns-tz": "^1.3.3", "decode-uri-component": "^0.2.1", "dom-to-image": "^2.6.0", "dompurify": "^3.0.1", Loading client/src/components/DatasetInformation/DatasetInformation.test.js +2 −3 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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); }); Loading client/src/components/UtcDate.test.js +2 −1 Original line number Diff line number Diff line import { shallowMount } from "@vue/test-utils"; import { getLocalVue } from "tests/jest/helpers"; import UtcDate from "./UtcDate.vue"; import { format, parseISO } from "date-fns"; describe("UTCDate component", () => { const localVue = getLocalVue(); Loading @@ -16,6 +17,6 @@ describe("UTCDate component", () => { expect(wrapper.text()).toContain("years ago"); await wrapper.setProps({ mode: "pretty" }); expect(wrapper.text()).toBe("Wednesday Oct 21st 16:29:00 2015 UTC"); expect(wrapper.text()).toBe(format(parseISO("2015-10-21T16:29:00.000Z"), "eeee MMM do H:mm:ss yyyy zz")); }); }); client/src/components/UtcDate.vue +3 −5 Original line number Diff line number Diff line <script setup lang="ts"> import { formatDistanceToNow, parseISO } from "date-fns"; import { formatInTimeZone } from "date-fns-tz"; import { computed } from "vue"; import { format, formatDistanceToNow, parseISO } from "date-fns"; interface UtcDateProps { date: string; Loading @@ -12,13 +11,12 @@ const props = withDefaults(defineProps<UtcDateProps>(), { mode: "date", }); // Component assumes ISO format date, but note that in Galaxy this won't have // TZinfo -- it will always be Zulu const parsedDate = computed(() => parseISO(`${props.date}Z`)); const elapsedTime = computed(() => formatDistanceToNow(parsedDate.value, { addSuffix: true })); const fullISO = computed(() => parsedDate.value.toISOString()); const pretty = computed(() => `${formatInTimeZone(parsedDate.value, "Etc/Zulu", "eeee MMM do H:mm:ss yyyy")} UTC`); const pretty = computed(() => format(parsedDate.value, "eeee MMM do H:mm:ss yyyy zz")); </script> <template> <span v-if="mode == 'date'" class="utc-time" :title="elapsedTime"> {{ fullISO }} Loading client/yarn.lock +0 −5 Original line number Diff line number Diff line Loading @@ -4540,11 +4540,6 @@ data-urls@^3.0.2: whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" date-fns-tz@^1.3.3: version "1.3.6" resolved "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.6.tgz" integrity sha512-C8q7mErvG4INw1ZwAFmPlGjEo5Sv4udjKVbTc03zpP9cu6cp5AemFzKhz0V68LGcWEtX5mJudzzg3G04emIxLA== date-fns@^2.28.0: version "2.29.1" resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.29.1.tgz" Loading Loading
client/package.json +0 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ "d3-zoom": "^3.0.0", "d3v3": "npm:d3@3", "date-fns": "^2.28.0", "date-fns-tz": "^1.3.3", "decode-uri-component": "^0.2.1", "dom-to-image": "^2.6.0", "dompurify": "^3.0.1", Loading
client/src/components/DatasetInformation/DatasetInformation.test.js +2 −3 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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); }); Loading
client/src/components/UtcDate.test.js +2 −1 Original line number Diff line number Diff line import { shallowMount } from "@vue/test-utils"; import { getLocalVue } from "tests/jest/helpers"; import UtcDate from "./UtcDate.vue"; import { format, parseISO } from "date-fns"; describe("UTCDate component", () => { const localVue = getLocalVue(); Loading @@ -16,6 +17,6 @@ describe("UTCDate component", () => { expect(wrapper.text()).toContain("years ago"); await wrapper.setProps({ mode: "pretty" }); expect(wrapper.text()).toBe("Wednesday Oct 21st 16:29:00 2015 UTC"); expect(wrapper.text()).toBe(format(parseISO("2015-10-21T16:29:00.000Z"), "eeee MMM do H:mm:ss yyyy zz")); }); });
client/src/components/UtcDate.vue +3 −5 Original line number Diff line number Diff line <script setup lang="ts"> import { formatDistanceToNow, parseISO } from "date-fns"; import { formatInTimeZone } from "date-fns-tz"; import { computed } from "vue"; import { format, formatDistanceToNow, parseISO } from "date-fns"; interface UtcDateProps { date: string; Loading @@ -12,13 +11,12 @@ const props = withDefaults(defineProps<UtcDateProps>(), { mode: "date", }); // Component assumes ISO format date, but note that in Galaxy this won't have // TZinfo -- it will always be Zulu const parsedDate = computed(() => parseISO(`${props.date}Z`)); const elapsedTime = computed(() => formatDistanceToNow(parsedDate.value, { addSuffix: true })); const fullISO = computed(() => parsedDate.value.toISOString()); const pretty = computed(() => `${formatInTimeZone(parsedDate.value, "Etc/Zulu", "eeee MMM do H:mm:ss yyyy")} UTC`); const pretty = computed(() => format(parsedDate.value, "eeee MMM do H:mm:ss yyyy zz")); </script> <template> <span v-if="mode == 'date'" class="utc-time" :title="elapsedTime"> {{ fullISO }} Loading
client/yarn.lock +0 −5 Original line number Diff line number Diff line Loading @@ -4540,11 +4540,6 @@ data-urls@^3.0.2: whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" date-fns-tz@^1.3.3: version "1.3.6" resolved "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.6.tgz" integrity sha512-C8q7mErvG4INw1ZwAFmPlGjEo5Sv4udjKVbTc03zpP9cu6cp5AemFzKhz0V68LGcWEtX5mJudzzg3G04emIxLA== date-fns@^2.28.0: version "2.29.1" resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.29.1.tgz" Loading