I am running datePicker for the date of birth of a field in Yii2. I'm also trying to show the year. I checked the jQuery docs http://jqueryui.com/datepicker/#dropdown-month-year and I thought I could achieve this with changeYear . But it doesn't seem to work. How to do it? This is my current code.
<?= $form->field($model, 'date_of_birth')->widget(DatePicker::className(),[ 'name' => 'date_of_birth', 'language' => 'en-GB', 'dateFormat' => 'yyyy-MM-dd', 'options' => [ 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '1996:2099', 'showOn' => 'button', 'buttonImage' => 'images/calendar.gif', 'buttonImageOnly' => true, 'buttonText' => 'Select date' ], ]) ?>
source share