showMonths bug when programatically updating MinDate
See original GitHub issueI’m submitting a … (check one with “x”)
[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 : 2.5.17
- Browser name and version : Chrome 68
- This package version : 8.0.0
Current behavior I’m trying to use two flatpickr elements to implement a range picker, as described in https://github.com/ankurk91/vue-flatpickr-component/issues/20.
However I’ve discovered a bug when using showMonths.
When programatically setting the minDate and when showMonths is set (to 3 in this example), the month/year display is offset by 3 months incorrectly. The dates within the datepicker themselves are correct, however.
Every time the minDate is updated, it is further offset by the showMonths value.
This should show the issue:
Expected behavior The current Month / Year should display the correct month/year values.
Demo Link: https://jsfiddle.net/63kzdwLx/2751/
PS- Working fiddle https://jsfiddle.net/63kzdwLx/2760/
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
I was able re-produce the issue. The culprit is
showMonths
property, it happens whenshowMonths
is set to 1. I will look into it, will try to find a workaround.Possibly fixed by this PR in flatpickr:
https://github.com/flatpickr/flatpickr/pull/1413/commits/83cd33f60cb5c0bb4a730eebefd6594b49dc45b7
https://github.com/flatpickr/flatpickr/pull/1413