From e36144ce2cc43902c12c9737e2b5c87e7520fa09 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 9 Jun 2021 15:42:29 +0000 Subject: [PATCH] --- ayanova/src/api/locale.js | 29 +++++++++++++++++++++--- ayanova/src/views/home-notifications.vue | 29 ++++++++++++++---------- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index 2e5f2088..0087a509 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -182,11 +182,12 @@ export default { let theHours = 0; let theMinutes = 0; let theSeconds = 0; + let ret = ""; if (value == null) { - return ""; + return ret; } else { - let work = vm.value.split(":"); + let work = value.split(":"); //has days? if (work[0].includes(".")) { let dh = work[0].split("."); @@ -203,8 +204,30 @@ export default { } else { theSeconds = Number(work[2]); } + + if (theDays != 0) { + ret += theDays + " " + window.$gz.translation.get("TimeSpanDays") + " "; + } + if (theHours != 0) { + ret += + theHours + " " + window.$gz.translation.get("TimeSpanHours") + " "; + } + if (theMinutes != 0) { + ret += + theMinutes + + " " + + window.$gz.translation.get("TimeSpanMinutes") + + " "; + } + if (theSeconds != 0) { + ret += + theSeconds + + " " + + window.$gz.translation.get("TimeSpanSeconds") + + " "; + } + return ret; } - todo: finish this then move on to the UI part and jam this in }, /////////////////////////////////////////////// // Convert a utc date to local time zone diff --git a/ayanova/src/views/home-notifications.vue b/ayanova/src/views/home-notifications.vue index 8080b012..09df2043 100644 --- a/ayanova/src/views/home-notifications.vue +++ b/ayanova/src/views/home-notifications.vue @@ -22,19 +22,23 @@ :color="i.fetched ? 'grey lighten-2' : 'primary'" > - {{ i.name }} + {{ i.name + }} + ({{ i.ageValueViz }}) {{ i.uicreated }} - {{ i.uievent }} + >
{{ i.message }}
-
- {{ i.ageValue }} -
@@ -43,11 +47,8 @@ text @click="openSubscription(i)" v-if="i.eventType != 27" - >{{ $ay.t("NotifySubscription") }}{{ $ay.t("Open") }} - {{ - $ay.t("Open") - }}
@@ -200,6 +201,10 @@ export default { if (temp[i].name == "~SERVER~") { temp[i].name = vm.$ay.t("Server"); } + + temp[i].ageValueViz = window.$gz.locale.durationLocalized( + temp[i].ageValue + ); } vm.obj = [...temp];