Closed thinker-amir closed 4 years ago
Yeah, you can.
The option calendarType is initially set to 'persian', Just overwrite the default value of that option in clientOptions:
use mrlco\datepicker\Datepicker;
// As a widget
echo Datepicker::widget([
'model' => $model,
'attribute' => 'date',
'template' => '{addon}{input}',
'clientOptions' => [
'format' => 'YYYY/MM/DD',
'calendarType' => 'gregorian' // here we set the calendar
]
]);
// within an ActiveForm instance
$form->field($model, 'date')->widget(
Datepicker::className(), [
'inline' => true,
'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
'clientOptions' => [
'format' => 'YYYY/MM/DD',
'calendarType' => 'gregorian' // here we set the calenda
]
]);?>
hi, we can do save date value in Gregorian format with this datePicker?