longbill / jquery-date-range-picker

A jQuery plugin that allows user to select a date range
MIT License
1.12k stars 579 forks source link

Option to lock start #484

Closed mbartocci closed 4 years ago

mbartocci commented 4 years ago

Option to lock the start date and change only the end date

monovertex commented 4 years ago

I'm not exactly sure that this option is necessary. You can easily reproduce the behavior you want by using the setStart API method to force the start date to be set when opening the modal or the setEnd when the user clicks the first date (via the datepicker-first-date-selected event). I would avoid adding new options if something is easily achievable with the current API.

Feel free to continue the discussion here and I will reopen this if I missed something and this is indeed necessary.

mbartocci commented 4 years ago

I tried to use datepicker-first-date-selected event but I couldn't to set start and end value. I need that the click changes only end range.

monovertex commented 4 years ago

Can you provide a JSFiddle with a minimum reproduction of the code you tried and did not work as expected?