Wednesday, August 17, 2011

Really Basic CJuiDatePicker Example


Here's a CJuiDatePicker example with the basic parameters and a couple of the optional JavaScript options. In particular, I like using the dateFormat option to format my date the way I want to save it in the db.


<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'model'=>$model,
   'attribute'=>'release_date',
   // additional javascript options for the date picker plugin
   'options'=>array(
       'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
   ),
   'htmlOptions'=>array(
       'style'=>'height:20px;',
   ),
));
?>

1 comment: