Skip to content

Commit

Permalink
Updated code to display the correct estimated delivery date(#2me4rbb)
Browse files Browse the repository at this point in the history
  • Loading branch information
disha1202 committed Jul 26, 2022
1 parent 71bc3a5 commit 4104dee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/views/OrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,15 @@ export default defineComponent({
}
},
getEstimatedDeliveryDate(item: any, label: string){
const labelMapping = {
"BACKORDER": "Back Order",
"PRE-ORDER": "Pre Order",
} as any
if(this.checkPreorderBackorderItem(item) === labelMapping[label]) {
return item.properties.find((property: any) => property.name === "PROMISE_DATE") ? item.properties.find((property: any) => property.name === "PROMISE_DATE").value : "";
}
const product = this.getPreorderItemAvailability(item.sku);
if(product.label === label){
if(this.checkPreorderBackorderItem(item)){
return item.properties.find((property: any) => property.name === "PROMISE_DATE") ? item.properties.find((property: any) => property.name === "PROMISE_DATE").value : "";
}
return DateTime.fromISO(product.estimatedDeliveryDate).toFormat("MM/dd/yyyy");
}
}
Expand Down

0 comments on commit 4104dee

Please sign in to comment.