WIP MMCM
This commit is contained in:
@@ -13,6 +13,8 @@ const afterTomorrow =
|
||||
days: 2
|
||||
})
|
||||
|
||||
const timestampConverter = (digit13) => digit13 / 1000
|
||||
|
||||
export const useMMCMStore = defineStore('counter', {
|
||||
state: () => ({
|
||||
street: '',
|
||||
@@ -21,15 +23,16 @@ export const useMMCMStore = defineStore('counter', {
|
||||
productList: [],
|
||||
withPrescription: null,
|
||||
idProduct: null,
|
||||
dateDelivery: null,
|
||||
dateCollect :null
|
||||
dateDelivery: null, // 13 digit timestamp millisecond
|
||||
dateCollect: null
|
||||
}),
|
||||
getters: {
|
||||
fullAddress: (state) => state.street + ' ' + state.zipCode + ' ' + state.city,
|
||||
deliveryMethod: (state) => state.productList.filter(p => p.id === state.idProduct)[0].name,
|
||||
dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR"),
|
||||
minDateForDelivery : (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? today : tomorrow ,
|
||||
needPrescriptionDateCollect : (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription),
|
||||
minDateForDelivery: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? today : tomorrow,
|
||||
needPrescriptionDateCollect: (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription),
|
||||
dateDeliveryTimestampInSecond: (state) => timestampConverter(state.dateDelivery)
|
||||
},
|
||||
actions: {
|
||||
setStreet(street) {
|
||||
|
||||
Reference in New Issue
Block a user