diff --git a/src/layouts/duplicate-check/duplicate-check.vue b/src/layouts/duplicate-check/duplicate-check.vue index 339bb50a..d28c1176 100644 --- a/src/layouts/duplicate-check/duplicate-check.vue +++ b/src/layouts/duplicate-check/duplicate-check.vue @@ -159,8 +159,18 @@ export default { ); } }, + /** + * @param date date string in YYYY-MM-DDTHH:mm:ss format. + * @summary Converts a date string from YYYY-MM-DDTHH:mm:ss to M-DD-YYYY + */ getDateMinusTime(date) { - return date.substring(0, 10); + const yyyyMmDd = date.substring(0, 10).split('-'); + const year = yyyyMmDd[0]; + const month = yyyyMmDd[1][0] === '0' + ? yyyyMmDd[1][1] + : yyyyMmDd[1]; + const day = yyyyMmDd[2]; + return `${month}/${day}/${year}`; }, titleCase(str) { const temp = str.toLowerCase().split(' '); diff --git a/src/store/index.js b/src/store/index.js index 5e6da404..965c9455 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -205,7 +205,9 @@ export const useMainStore = defineStore({ }, eventBus: (state) => state.applicationUser.eventBus, applicationUserObj: (state) => state.applicationUser, - pageData: (state) => (page) => state.applicationUser.pageData[page], + pageData: (state) => (page) => (page in state.applicationUser.pageData + ? state.applicationUser.pageData[page] + : undefined), customerData: (state) => { if (state.order.vehicle.registration.address) { const { registration } = state.order.vehicle;