diff --git a/src/components/InitialJobConfiguration.vue b/src/components/InitialJobConfiguration.vue index f6954aa1..2bfbcbdd 100644 --- a/src/components/InitialJobConfiguration.vue +++ b/src/components/InitialJobConfiguration.vue @@ -16,14 +16,14 @@ {{ $t("Run time") }} - {{ currentJob?.runTime ? getTime(currentJob?.runTime) : $t('Select run time') }} + {{ runTime ? getTime(runTime) : $t('Select run time') }} @@ -121,7 +121,7 @@ import { import { mapGetters, useStore } from "vuex"; import { translate } from "@/i18n"; import { DateTime } from 'luxon'; -import { handleDateTimeInput,isFutureDate } from '@/utils'; +import { handleDateTimeInput,isFutureDate, showToast } from '@/utils'; export default defineComponent({ name: "InitialJobConfiguration", @@ -143,9 +143,13 @@ export default defineComponent({ isOpen: false, lastShopifyOrderId: this.shopifyOrderId, minDateTime: DateTime.now().toISO(), - jobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + jobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + runTime: '' as any, } }, + mounted() { + this.runTime = this.currentJob?.runTime + }, props: ['type', 'shopifyOrderId'], computed: { ...mapGetters({ @@ -207,7 +211,14 @@ export default defineComponent({ }, updateRunTime(ev: CustomEvent, job: any) { if (job) { - job.runTime = handleDateTimeInput(ev['detail'].value) + const currTime = DateTime.now().toMillis(); + const setTime = handleDateTimeInput(ev['detail'].value); + + if(setTime > currTime) { + this.runTime = setTime; + } else { + showToast(translate("Provide a future date and time")) + } } } }, @@ -261,4 +272,10 @@ ion-item:nth-child(2) > ion-label:nth-child(3) { display: none; } } + +ion-modal { + --width: 290px; + --height: 440px; + --border-radius: 8px; +} \ No newline at end of file diff --git a/src/components/JobConfiguration.vue b/src/components/JobConfiguration.vue index 11536370..8cef84cd 100644 --- a/src/components/JobConfiguration.vue +++ b/src/components/JobConfiguration.vue @@ -16,7 +16,7 @@ {{ $t("Run time") }} - {{ currentJob?.runTime ? getTime(currentJob.runTime) : $t('Select run time') }} + {{ runTime ? getTime(runTime) : $t('Select run time') }}