i am using the kartik date range widget of the date picker, i would like to set the start and end date ranges to the current month.
Ie, if today is 8th June 2016, i need
<?= $form->field($model, 'sale_date')->widget(DatePicker::className(), [
'attribute' => 'sale_date',
'value' => '2016-06-01',
'type' => DatePicker::TYPE_RANGE,
'attribute2' => 'sale_date',
'value2' => '2016-06-30',
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy/mm/dd'
]
]); ?>
Can I do values dynamically ?
Edit:
I also just noticed when i pick the dates as above with the widget, for some reason, the first value keeps resetting itself to the same as the second value and i end up with ‘2016/06/30’ to ‘2016/06/30’
thx