From 632343b1eea7d5c398d6a229e817f2ce562e61c6 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Fri, 13 Oct 2023 00:14:35 -0400 Subject: [PATCH] Minor adjustments --- src/layouts/duplicate-check/duplicate-check.vue | 12 +++++++++++- src/store/index.js | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) 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;