Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] time-picker keyboard input does not respect date value #560

Open
RS-Sautter opened this issue Dec 7, 2020 · 1 comment
Open

[Bug] time-picker keyboard input does not respect date value #560

RS-Sautter opened this issue Dec 7, 2020 · 1 comment

Comments

@RS-Sautter
Copy link

Vue2-datepicker version: 3.8.1
Vue version: 2.6.12
Browser: Chrome 86

Steps to reproduce

  1. Set value for vue2-datepicker to now + 1day
  2. Set type to "time"
  3. Set disabled-date e.g. to: (date) => date < new Date()
  4. Now you can select a time value in the dropdown which is lower than the current time
  5. Bug: You cannot type in a time < now

Expected behavior
You also can type in a time value < now, because it is for tomorrow.

Actual behavior
It gets corrected to the previous value that was set.

Underlying Problem
In l.242 of src/date-picker.js the backupTime is set to new Date().
This means that it tries to construct a date from your time input + the other values (year, month, day) of new Date(). This leads to the conflict with the disabled-date function.

@RS-Sautter
Copy link
Author

#561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant