如何将剑道daterangepicker带入单个字段?不应有2个输入字段,例如开始日期和结束日期。选择范围后,输入字段应获得日期,如01-01-2019-20-09-2019 enter image description here
答案 0 :(得分:0)
您可以在DateTimePicker的开始日期和结束日期之间使用串联,例如
<script>
$(function() {
$('input[name="daterange"]').daterangepicker({
opens: 'left'
}, function(start, end, label) {
console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); // assign this to your textbox
});
});
</script>