<input data-bind="daterangepicker: dateRange" />
<button data-bind="daterangepicker: dateRange2"></button>
Single mode
<input data-bind="
daterangepicker: dateRange3,
daterangepickerOptions: {
single: true
}
"/>
Month picker
<input data-bind="
daterangepicker: dateRange4,
daterangepickerFormat: 'MMMM YYYY',
daterangepickerOptions: {
single: true,
periods: ['month']
}
"/>
Standalone & Single
<div data-bind="
daterangepicker: dateRange5,
daterangepickerFormat: 'MMMM YYYY',
daterangepickerOptions: {
single: true,
standalone: true
}
"/>
jQuery example
<input class="daterangepicker-field"></input>
$(".daterangepicker-field").daterangepicker({
forceUpdate: true,
callback: function(startDate, endDate, period){
var title = startDate.format('L') + ' – ' + endDate.format('L');
$(this).val(title)
}
});