Topic: TimePicker set Initial value
jyappcloudcentech premium asked 5 years ago
Is it possible for the time-picker to have an initial value set for it. I have an edit form and want to prepopulate the timepicker with the current value selected.
Mikołaj Smoleński staff answered 5 years ago
lyahim answered 5 years ago
Hello Mikolaj!
I have same issue. Your recommendation is an alternate workaround, but on datePicker component works the v-model attribute for initialize the value.
Thank you, Mihaly
<mdb-date-picker
:label="$t('match_create.event_date')"
type="text"
ref="eventDate"
v-model="match.eventDate"
class="required"
required
/>
</mdb-col>
<mdb-col col="5">
<mdb-time-picker
:label="$t('match_create.event_time')"
type="text"
v-model="match.startTime"
validation
:hours-format="24"
/>
</mdb-col>
Mikołaj Smoleński staff commented 5 years ago
In the new TimePicker2 setting default value using v-model directive works correctly. You can find latest documentation here: https://mdbootstrap.com/docs/vue/forms/time-picker/.
And here's working demo: https://vue.mdbootstrap.com/#/forms/pro/timepicker2
Best regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Vue
- MDB Version: 5.8.3
- Device: PC
- Browser: CHROME
- OS: Windows 10
- Provided sample code: No
- Provided link: No