diff --git a/src/utils/index.ts b/src/utils/index.ts index fc21b92..027388f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -37,10 +37,6 @@ const getTime = (time: any) => { return time ? DateTime.fromMillis(time).toLocaleString(DateTime.TIME_SIMPLE) : "-"; } -const getTimeFromSeconds = (time: any) => { - return time ? DateTime.fromSeconds(time).toLocaleString(DateTime.DATETIME_MED) : "-"; -} - function getDate(runTime: any) { return DateTime.fromMillis(runTime).toLocaleString(DateTime.DATE_MED); } @@ -59,4 +55,4 @@ function timeTillRun(endTime: any) { return DateTime.local().plus(timeDiff).toRelative(); } -export { getDate, getDateAndTime, getDateAndTimeShort, getTime, getTimeFromSeconds, showToast, hasError, sortSequence, timeTillRun } +export { getDate, getDateAndTime, getDateAndTimeShort, getTime, showToast, hasError, sortSequence, timeTillRun } diff --git a/src/views/BrokeringRoute.vue b/src/views/BrokeringRoute.vue index 38e1b37..db811b3 100644 --- a/src/views/BrokeringRoute.vue +++ b/src/views/BrokeringRoute.vue @@ -94,7 +94,7 @@

{{ translate("Scheduler") }}

- {{ timeTillJobUsingSeconds(job.nextExecutionDateTime) }} + {{ timeTillJob(job.nextExecutionDateTime) }}
@@ -108,7 +108,7 @@ {{ translate("Run time") }} - {{ job.paused === 'N' ? getTimeFromSeconds(job.nextExecutionDateTime) : "-" }} + {{ job.paused === 'N' ? getDateAndTime(job.nextExecutionDateTime) : "-" }} @@ -155,7 +155,7 @@ import ArchivedRoutingModal from "@/components/ArchivedRoutingModal.vue" import { OrderRoutingService } from "@/services/RoutingService"; import logger from "@/logger"; import { DateTime } from "luxon"; -import { hasError, getDate, getDateAndTime, getDateAndTimeShort, getTime, getTimeFromSeconds, showToast, sortSequence, timeTillRun } from "@/utils"; +import { hasError, getDate, getDateAndTime, getDateAndTimeShort, getTime, showToast, sortSequence, timeTillRun } from "@/utils"; import emitter from "@/event-bus"; import { translate } from "@/i18n"; import GroupHistoryModal from "@/components/GroupHistoryModal.vue" @@ -316,11 +316,11 @@ async function saveSchedule() { } } -function timeTillJobUsingSeconds(time: any) { +function timeTillJob(time: any) { if(!time) { return; } - const timeDiff = DateTime.fromSeconds(time).diff(DateTime.local()); + const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); return DateTime.local().plus(timeDiff).toRelative(); } diff --git a/src/views/BrokeringRuns.vue b/src/views/BrokeringRuns.vue index 3c36825..b6e3a3d 100644 --- a/src/views/BrokeringRuns.vue +++ b/src/views/BrokeringRuns.vue @@ -50,17 +50,17 @@ - {{ group.schedule ? getTimeFromSeconds(group.schedule.nextExecutionDateTime) : "-" }} + {{ group.schedule ? getDateAndTime(group.schedule.nextExecutionDateTime) : "-" }}

{{ group.schedule ? getScheduleFrequency(group.schedule.cronExpression) : "-" }}

- {{ group.schedule ? timeTillRunUsingSeconds(group.schedule.nextExecutionDateTime) : "-" }} + {{ group.schedule ? timeTillRun(group.schedule.nextExecutionDateTime) : "-" }}
- {{ group.schedule ? getTimeFromSeconds(group.schedule.nextExecutionDateTime) : "-" }} + {{ group.schedule ? getDateAndTime(group.schedule.nextExecutionDateTime) : "-" }} {{ translate("Draft") }} @@ -82,7 +82,7 @@ import emitter from "@/event-bus"; import { translate } from "@/i18n"; import { Group } from "@/types"; -import { getDateAndTime, getTimeFromSeconds, showToast } from "@/utils"; +import { getDateAndTime, showToast } from "@/utils"; import { IonBadge, IonButton, IonButtons, IonCard, IonContent, IonHeader, IonIcon, IonItem, IonLabel, IonList, IonListHeader, IonPage, IonRadioGroup, IonRadio, IonSearchbar, IonSpinner, IonTitle, IonToolbar, alertController, onIonViewWillEnter } from "@ionic/vue"; import { addOutline } from "ionicons/icons" import { DateTime } from "luxon"; @@ -110,8 +110,8 @@ onIonViewWillEnter(async () => { store.dispatch("util/fetchEnums", { parentTypeId: "ORDER_ROUTING" }) }) -function timeTillRunUsingSeconds(time: any) { - const timeDiff = DateTime.fromSeconds(time).diff(DateTime.local()); +function timeTillRun(time: any) { + const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); return DateTime.local().plus(timeDiff).toRelative(); }