wakirin / Litepicker

Date range picker - lightweight, no dependencies
MIT License
896 stars 132 forks source link

setDateRange Resets existing lockDays #277

Open JackThomas opened 2 years ago

JackThomas commented 2 years ago

Describe the bug I've also got an attribute passing in an array of locked dates. Then I'm using a data attribute to pass in two date values then using setDateRange to highlight these dates. It seems like the locked dates are being reset or cleared when using setDateRange. Im not sure if I'm using this incorrectly and there is a proper way of using these two options together.

To Reproduce Steps to reproduce the behavior:

  1. Create new picker instance with lockedDays option
  2. Use .setDateRange() on picker

Expected behavior Have the setDatesRange select and leave the existing lockedDates in place.

jsfiddle.net / codepen.io / etc https://jsfiddle.net/5yzc7aex/1/

nehasi2x commented 2 years ago

hello, in lite picker if i have selected any date range... on page reload it is getting reset. how to keep the selected value on page load . Can you please help with this