Open stevelacey opened 10 years ago
I determined that there is no support for this, however it is pretty easy to set up manually.
Simply instantiate 2 datepickers, and then replicate the adding of the range classes in the beforeShowCallback
, and process the data yourself.
options
beforeShowDay: (date) =>
classes = []
if @dates().length == 2
classes.push 'range' if date >= @dates()[0] and date <= @dates()[1]
classes: classes.join ' '
NB: my example is pretty much lifted out of my implementation and won't /just work/, @dates()
returns an array of regular JS Date objects that I pull out of the form I populate manually in the changeDate
callback.
Is there any way to use the range picker as a component, i.e. not dropping down from an input?
I am building an interface which allows uses to switch between "multiple date" and "date range" modes, so consistency between the two would be good, and I want to use component for both.