Skip to content

Commit

Permalink
Improved: date formatting inside the cancel confirm modal(hotwax#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Jan 8, 2025
1 parent f3f8cf5 commit fcf3c8a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/ConfirmCancelModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
{{ translate("Estimated time to refund customer on Shopify") }}
<p>{{ translate("Showing the next estimated time to sync cancelation to Shopify") }}</p>
</ion-label>
<ion-note slot="end">{{ cancelJobNextRunTime }}</ion-note>
<ion-note slot="end">{{ runTimeDiff }}</ion-note>
</ion-item>
<ion-item lines="full" v-else-if="isCancelationSyncJobEnabled">
<ion-label>
{{ translate("Estimated time to cancelation on Shopify") }}
<p>{{ translate("Showing the next estimated time to sync cancelation to Shopify") }}</p>
<p>{{ translate("Cancelation sync to Shopify is enabled. Refund processing is disabled.") }}</p>
</ion-label>
<ion-note slot="end">{{ cancelJobNextRunTime }}</ion-note>
<ion-note slot="end">{{ runTimeDiff }}</ion-note>
</ion-item>
<ion-item lines="full" v-else>
<ion-label>
Expand Down Expand Up @@ -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",
Expand All @@ -109,7 +110,8 @@ export default defineComponent({
return {
cancelledItems: [] as Array<any>,
orderTotal: 0,
currentOrder: {} as any
currentOrder: {} as any,
runTimeDiff: ""
}
},
computed: {
Expand All @@ -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() {
Expand Down

0 comments on commit fcf3c8a

Please sign in to comment.