diff --git a/src/components/ConfirmCancelModal.vue b/src/components/ConfirmCancelModal.vue index 818dd482c..b1841d1f7 100644 --- a/src/components/ConfirmCancelModal.vue +++ b/src/components/ConfirmCancelModal.vue @@ -35,7 +35,7 @@ {{ translate("Estimated time to refund customer on Shopify") }}

{{ translate("Showing the next estimated time to sync cancelation to Shopify") }}

- {{ cancelJobNextRunTime }} + {{ runTimeDiff }} @@ -43,7 +43,7 @@

{{ translate("Showing the next estimated time to sync cancelation to Shopify") }}

{{ translate("Cancelation sync to Shopify is enabled. Refund processing is disabled.") }}

- {{ cancelJobNextRunTime }} + {{ runTimeDiff }}
@@ -85,6 +85,7 @@ import { getProductIdentificationValue, translate, useProductIdentificationStore import { isKit } from "@/utils/order" import { showToast } from "@/utils"; import { hasError } from "@hotwax/oms-api"; +import { DateTime } from "luxon"; export default defineComponent({ name: "ConfirmCancelModal", @@ -109,7 +110,8 @@ export default defineComponent({ return { cancelledItems: [] as Array, orderTotal: 0, - currentOrder: {} as any + currentOrder: {} as any, + runTimeDiff: "" } }, computed: { @@ -123,6 +125,8 @@ export default defineComponent({ this.currentOrder = JSON.parse(JSON.stringify(this.order)) this.cancelledItems = this.currentOrder.part.items.filter((item: any) => item.cancelReason) this.orderTotal = this.cancelledItems.reduce((total: any, item: any) => this.getProduct(item.productId).LIST_PRICE_PURCHASE_USD_STORE_GROUP_price + total, 0) + const timeDiff = DateTime.fromMillis(this.cancelJobNextRunTime).diff(DateTime.local()); + this.runTimeDiff = DateTime.local().plus(timeDiff).toRelative(); }, methods: { closeModal() {