Dear All,
I have a problem with CjuiDatePicker, I need to display the birthDate as ‘dd-mm-yyyy’ but mysql only accept ‘yyyy-mm-dd’. I use pure CjuiDatePicker solution instead of beforeSave/afterFind
This is my CJuiDatePicker
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name' => 'dateOfBirth',
'value' => $birthOfDate,
'options' => array(
'showAnim' => 'fold',
'dateFormat' => 'dd-mm-yy',
'altFormat' => 'yy-mm-dd',
'altField' => '#Member_birthDate',
'changeMonth' => 'true',
'changeYear' => 'true',
'yearRange' => '1920:+0',
[color="#FFFF00"]'onSelect' => "js:function() {}",[/color]
),
'htmlOptions' => array(
'class' => 'small',
),
));
echo CHtml::activeHiddenField($model, 'birthDate');
If I chose using datepicker, the $model->birthDate is updated as expected.
I need to add [color="#FFFF00"]‘onSelect’ => “js:function() {}”,[/color], If I want this solution is also works by typing the date into the textfield. Without this line, my datepicker will not update the $model->birthDate like situation if I pick the date from datepicker.
But still, I have issue, my browser keeps history of the date have been entered. If, I am not chosing from date picker or type the date, but select one from the history/cache, It eill not udpate the $model->birthDate.
Any hints, whout should I do?