question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Time picker sets default value on the form input but no v-model value when clicked

See original GitHub issue

I’m submitting a …

[x] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[ ] Other, please describe

Tell about your platform

  • flatPickr version : 4.5.2
  • Vue.js version : 3.0.5
  • Browser name and version : Firefox 63.0.3
  • This package version : 8.0.0

Current behavior

Time picker puts a default value (in my case 12:00) but no v-model equivalent value when it is clicked.

model

Expected behavior

If time picker form is clicked there should be no default value put on the form. Or immediately set the v-model to the default value when it’s clicked.

Minimal reproduction of the problem with instructions I only set my flatpickr config to this:

enableTime: true,
noCalendar: true,
dateFormat: "U",
altInput: true,
altFormat: "h:i K",

And my flatpickr:

<flat-pickr v-model="myTime" class="input" placeholder="Time" :config="pickr.time"></flat-pickr>

https://jsfiddle.net/kqvhzxy2/2/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
asharghicommented, Jan 30, 2019

For anyone finding this. No need for a method. Just do:

<flat-pickr v-model=“date” :config=“config” @on-close=“date = $event” />

0reactions
fobiasmogcommented, Apr 6, 2019

Another issue solution is use watch https://jsfiddle.net/zbrejkin/n84y65w0/13/

Read more comments on GitHub >

github_iconTop Results From Across the Web

time value through v-model not updating on vue2-datepicker ...
I am using vue2-datepicker <date-picker type="time" id="start" :time-picker-options="startTimeOptions" v-model="start" value-type="time" ...
Read more >
Form Timepicker | Components - BootstrapVue
BootstrapVue custom time picker input form control, which provides full WAI-ARIA accessibility (a11y) and supports internationalization (i18n).
Read more >
Select | Quasar Framework
This component opens up a menu for the selection list and action. ... icon when a value (not undefined or null) is set;...
Read more >
Inputs — Essentials ⚡️ FormKit — Vue Forms, Supercharged
The value prop should only be used for setting the initial value of an input. It will not react to changes after the...
Read more >
How to set a default value to input with a v-model via HTML?
You need to assign your prop value to a data property and pass that data property to the v-model. Example. Copy Code //...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found