From b4c716302fa680d613695f02ab94545b8e9dcaac Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 2 Mar 2022 21:22:44 +0530 Subject: [PATCH] Don't show duration on scheduled campaigns that are finished. Closes #701. --- frontend/src/utils.js | 2 ++ frontend/src/views/Campaigns.vue | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 697c36f3..2a9ec842 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -49,6 +49,8 @@ export default class Utils { } } + getDate = (d) => dayjs(d); + // Parses an ISO timestamp to a simpler form. niceDate = (stamp, showTime) => { if (!stamp) { diff --git a/frontend/src/views/Campaigns.vue b/frontend/src/views/Campaigns.vue index 2fa5510f..6c79e25c 100644 --- a/frontend/src/views/Campaigns.vue +++ b/frontend/src/views/Campaigns.vue @@ -61,8 +61,11 @@ - {{ $utils.duration(Date(), props.row.sendAt, true) }} -
{{ $utils.niceDate(props.row.sendAt, true) }} + + {{ $utils.duration(new Date(), props.row.sendAt, true) }} +
+
+ {{ $utils.niceDate(props.row.sendAt, true) }}