I'm experimenting with Boootstrap Date Range Picker
Whats the best way to set Date into a Single Date Picker via Javascript?
Single Date Picker initialization code
$(#date).daterangepicker({
locale: {
format: 'DD/MM/YYYY',
},
singleDatePicker: true,
showDropdowns: true
});
I tried with below code:
$("date").data('daterangepicker').setStartDate(data.startDate);
This way, I'm getting below output, which is not really acceptable!!!
Hope someone come up with a nice solution.
Cheers!!
Try
$("date").data('daterangepicker').setStartDate(data.startDate);
$("date").data('daterangepicker').setEndDate(data.startDate);
That is the only way I can find so far.