Minor adjustments

This commit is contained in:
Michaela Brydon 2023-10-13 00:14:35 -04:00
parent 3f6c8dbf93
commit 632343b1ee
2 changed files with 14 additions and 2 deletions

View file

@ -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(' ');

View file

@ -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;