Sivanthi
(Sivanthi071)
1
I just learned how to add datepicker in form.
echo $form->labelEx($model,'datecolumn name');
The Above line display label for date column.
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'Modelname[datecolumn name]',
'id'=>'Modelname_datecolumn name',
'value'=>Yii::app()->dateFormatter->format("d-M-y",strtotime($model->datecolumn_name)),
'options'=>array(
'showAnim'=>'fold',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
from the above lines,
name and id attributes are represent html attributes [name,id] of the input.
value option displays saved date during edit / update operation.
lalzada
(Lalzadamohmand)
2
THnxxxxxxxx…it works fine <><>
frienddebu
(D C Urfriend)
3
Thnx itz wworks for me too
vanthiem
(Vanthiemmt2)
4
This is work for me too. Thanks
ltphuc
(Nhoem2006172000)
6
You save my times. Thanks!
this doesn’t works for me… no data is being saved in the database
<div class="row">
<?php echo $form->labelEx($model,'arrival'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'arrival',
'id'=>'arrival',
'value'=>Yii::app()->dateFormatter->format("d-M-y",strtotime($model->day_nos)),
'options'=>array(
'showAnim'=>'fold',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
)); ?>
<?php echo $form->error($model,'arrival'); ?>
</div>
Please Help
The Date picker is coming fine but Date Format is changing when i change the date
Initially it appearing in 2015-03-11 format late changing to 03/11/2015.
Please provide some alternative solution.
[
‘attribute’ => ‘post_date’,
‘value’ => ‘post_date’,
‘format’ => ‘raw’,
‘filter’ => DatePicker::widget([
‘model’ => $searchModel,
‘attribute’ => ‘post_date’,
‘options’ => [
‘id’ => ‘datepickerT’
],
‘clientOptions’ => [
‘autoclose’ => true,
‘format’ => ‘yyyy-mm-dd’,
]
]),
], correct the format if any one needs it