chrisdavies / tiny-date-picker

A small, modern, dependency-free date picker
https://chrisdavies.github.io/tiny-date-picker/
415 stars 88 forks source link

dynamically update DateRangePicker options (e.g. inRange()) #121

Closed cenda closed 4 years ago

cenda commented 4 years ago

Hi, thanks for this library. Am I missing something, or is not possible during setState or with any other option update inRange function?

Goal I want to achieve: After select start date I want to limit end date possibility to max state.start + <some offset days>.

Is this possible somehow?

Thanks for your advice.

cenda commented 4 years ago

Solved.

If anyone is interested: in inRange() method I check if is set start in current state. If so inRange() returns another set of "valid" days than in case when either state.start is set or is set along with state.end.