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.

showMonths bug when programatically updating MinDate

See original GitHub issue

I’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: gif2

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:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ankurk91commented, Sep 19, 2018

I was able re-produce the issue. The culprit is showMonths property, it happens when showMonths is set to 1. I will look into it, will try to find a workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

changing minDate option in JQuery DatePicker not working
Just answering this for best practice; the minDate option expects one of: a string in the current dateFormat OR; number of days from...
Read more >
react-datetime | Yarn - Package Manager
By default the updating view will get guessed by using the dateFormat so if our dates only show months and never days, the...
Read more >
FlatpickrDirective - angularx-flatpickr documentation
Gets triggered when the input value is updated with a new date string. ... Gets triggered when the year is changed, either by...
Read more >
jQuery Datepicker - Keith Wood
A jQuery plugin that attaches a popup calendar to your input fields or shows an inline calendar for selecting individual dates or date...
Read more >
Datepicker Widget - jQuery UI API Documentation
This widget manipulates its element's value programmatically, therefore a native ... instance and returns an options object to update the datepicker with.
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