我想将结束date
设置为与开始date
相同:
<?php
echo $form->field($model, 'date_range', [
'options' => ['class' => 'drp-container form-group']
])->widget(DateRangePicker::classname(), [
'id' => 'dateRange',
'convertFormat' => true,
'pluginOptions' => [
'timePicker' => true,
'timePicker24Hour' => true,
'timePickerIncrement' => 1,
'autodate' => true,
'minDate' => (string) date('Y-m-d H:i:s', strtotime('- 1 month')),
'maxDate' => (string) date('Y-m-d H:i:s'),
'singleDatePicker' => false,
'autoApply' => false,
'locale' => ['format' => 'Y-m-d H:i:s']
],
'pluginEvents' => [
],
])
?>
当我尝试选择这样的结束日期时,它无法正常运行:
$(document).on('click', 'td.available', function (e) {
$('#dateRange').data('daterangepicker').setEndDate(date);
})
是否有可能让它像我想的那样工作?
问候!