I'm currently working with flat-pickr. Let's dive into the configuration part of it. I have a start date field and an end date field. My goal is to make it so that when a time is selected in the start date field, it defaults to 12h AM, and when a time is chosen in the end date field, it defaults to 12h PM.
https://i.sstatic.net/f4Umf.jpg
// Start Date
<flat-pickr
id="campaign-startdate"
v-model="model.startdate"
class="form-control"
:config="formatStartDate"
/>
// End Date
<flat-pickr
id="campaign-enddate"
v-model="model.endDate"
class="form-control"
:config="formatEndDate"
/>
data() {
return: {
model:{
startDate: null,
endDate: null,
},
formatStartDate: {
enableTime: true,
dateFormat: 'd-m-Y H:i'
},
formatEndDate: {
enableTime: true,
dateFormat: 'd-m-Y H:i'
}
}
}