yii2-datecontrol
yii2-datecontrol copied to clipboard
Enhance DateControl to support Date Ranges
Support two options using DatePicker::TYPE_RANGE and DateRangePicker
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Ah, good to see this is already being worked on. I just tried to use the following:
<?= $form->field($model, 'rented_timestamp')->widget(DateControl::className(), [
'type'=> DateControl::FORMAT_DATE,
'saveFormat' => 'php:Y-m-d H:i:s',
'options' => [
'type' => DatePicker::TYPE_RANGE,
'attribute2' => 'due_timestamp',
'pluginOptions' => [
'todayHighlight' => TRUE,
'autoclose' => TRUE,
'todayBtn' => 'linked',
'minView' => 2
]
]
]) ?>
And it only creates a hidden field for the first input element.
I tried the code and only stores the first field, the second field attribute2 not save it.
Thks, @EAnushan
@EAnushan & @tecnologiaterabyte ... as I mentioned in this comment --- DateControl will not work with RANGE - because it currently only understands one input to convert...
:No problem kartikv you just commented. :+1:
Any updates on this? :)
Sorry not got time to look into this. Will do so when I get time. Feel free to submit a PR if you wish to speeden this.
+1
+1
+1