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

Year-Selection is buggy for inline picker #380

Open SidduSomething opened 7 years ago

SidduSomething commented 7 years ago

For inline range-pickers, the year-selection doesnt work as expected once a selection is made:

https://jsfiddle.net/w4gyayuc/1/

In the above fiddle, select a date-range and then try changing the year. (Please let me know if you are not able to reproduce it)

However, if you run the same by commenting out the line container: '#container', it works fine.

I found that for inline pickers, additionally, this line gets executed on year-selection and that is what seems to be affecting the behavior: https://github.com/longbill/jquery-date-range-picker/blob/79f6e9149b0a120b3de3bbb508dc2711a0ca33ed/src/jquery.daterangepicker.js#L933-L934

Please push a fix for it. Thanks in advance.