TimePicker set Initial value


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

Hi there,

Have you tried to use placeholder property?

Best regards


lyahim answered 4 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 4 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


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • 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
Tags