skratchdot / react-bootstrap-daterangepicker

A date/time picker for react (using bootstrap). This is a react wrapper around the bootstrap-daterangepicker project.
http://projects.skratchdot.com/react-bootstrap-daterangepicker/
Other
474 stars 203 forks source link

Can't set singleDatePicker dynamically #123

Closed leocristofani closed 4 years ago

leocristofani commented 7 years ago

I need to set singleDatePicker dynamically but when I switch "singleDatePicker" between true and false, it does NOT update the dropdown between single and double calendar. Any idea how to fix this?

`<DateRangePicker name={name} startDate={startDate} endDate={endDate} className="form-control" onApply={applyHandler(onChange)} locale={{ format: 'YYYY-MM-DD' }} singleDatePicker

{displayDate(value, singleDatePicker)}`

Thanks for this component!

CarlosHdez commented 7 years ago

Did you managed to fix this, I'm experiencing the same problem.

Thanks

ashiquemohammed commented 5 years ago

Ran into the same issue . Hoping for a solution .

hassanuos commented 5 years ago

Guys try this. Its working for me.

$('#date_range').data('daterangepicker').singleDatePicker = false; //for double calendar $('#date_range').data('daterangepicker').singleDatePicker = true; // for single calendar

skratchdot commented 4 years ago

closing this due to inactivity. please re-open if this is still an issue in v6.0.0 or greater