From 6f767abec167e4d2f9b58c0ff248b26dddfd1559 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 2 Oct 2022 02:56:01 +0200 Subject: [PATCH] frontend use exact time in every case --- frontend/src/lib/components/jobs/JobDetail.svelte | 2 +- frontend/src/lib/utils.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/jobs/JobDetail.svelte b/frontend/src/lib/components/jobs/JobDetail.svelte index cbed387439..bd29bf98ee 100644 --- a/frontend/src/lib/components/jobs/JobDetail.svelte +++ b/frontend/src/lib/components/jobs/JobDetail.svelte @@ -114,7 +114,7 @@
-
+
By {job.created_by} 7) { + return `${dAgo + 1} days ago at ${date.toLocaleTimeString()}` } else { - return `${dAgo + 1} days ago` + return displayDate(dateString) } } } @@ -54,9 +56,8 @@ export function displayDate(dateString: string | undefined): string { if (date.toString() === 'Invalid Date') { return '' } else { - return `${date.getFullYear()}/${ - date.getMonth() + 1 - }/${date.getDate()} at ${date.toLocaleTimeString()}` + return `${date.getFullYear()}/${date.getMonth() + 1 + }/${date.getDate()} at ${date.toLocaleTimeString()}` } }