flatpickr icon indicating copy to clipboard operation
flatpickr copied to clipboard

Time-only picker does not honor minDate when applied via set()

Open iamthechad opened this issue 9 years ago • 1 comments

Expected Behavior

When I create a time-only picker with noCalendar: true and enableTime: true, I want to be able to restrict the earliest time selection via minDate.

Current Behavior

Specifying minDate in the configuration options causes the correct behavior. The time is properly constrained.

Dynamically setting minDate via the set("minDate", someDate) does not work correctly. The time values are not constrained at all.

It seems to be the combination of noCalendar and enableTime that is causing the issue. If I do not disable the calendar, setting minDate via set() works as expected and values are constrained.

Steps to Reproduce (for bugs)

Please the CodePen at http://codepen.io/iamthechad/pen/bgvwBd where all 3 behaviors are shown

Context

We've implemented a date/time range scenario using two separate controls, with start range selection being used to constrain the end range via setting minDate. We'd like to extend this to time ranges, which should be very simple via the noCalendar config.

Your Environment

  • Version used: 2.3.5
  • Browser Name and version: Chrome 55.0, MS Edge 38.14393
  • Operating System and version (desktop or mobile): Windows 10

iamthechad avatar Feb 01 '17 19:02 iamthechad

Having the same issue currently.

mtpc avatar Feb 06 '17 16:02 mtpc