Bootstrap Jalali Date Picker
Jalali Date Picker for Bootstrap Yii2 Extension, (*1)
, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist faravaghi/yii2-jalali-datepicker "*"
or add, (*5)
"faravaghi/yii2-jalali-datepicker": "*"
to the require section of your composer.json
file., (*6)
Usage
Once the extension is installed, simply use it in your code by :, (*7)
field(
$model,
'date'
)
->widget(
jalaliDatePicker::className(), [
'options' => array(
'format' => 'yyyy/mm/dd',
'viewformat' => 'yyyy/mm/dd',
'placement' => 'left',
'todayBtn'=> 'linked',
),
'htmlOptions' => [
'id' => 'date',
'class' => 'form-control'
]
]);
?>
or without using the model:, (*8)
echo faravaghi\jalaliDatePicker\jalaliDatePicker::widget([
'name' => 'startDate',
'value' => '1397/06/20',
'options' => array(
'format' => 'yyyy/mm/dd',
'viewformat' => 'yyyy/mm/dd',
'placement' => 'left',
'todayBtn'=> 'linked',
),
]);