Hi.,
Can Any one tell me procedure or how to use extensions for time, datepicker. Datepicker/Timepicker when a textfield is clicked.
thanks…
Aruna
Hi.,
Can Any one tell me procedure or how to use extensions for time, datepicker. Datepicker/Timepicker when a textfield is clicked.
thanks…
Aruna
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name'=>'Model_name[Input_element_name]',
'model'=>$model,
'attribute'=>'Input_element_name',
'options'=>array(
'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
?>
Hi…
Thanks for your response.,
But i dont know where to use this code can tell me the procedure to do so…
Thanks
Aruna
It has to be added in the view form in which your are defining the text field
div class="row">
<?php echo $form->labelEx($model,'This order valid till'); ?>
<?php echo $form->$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'valid_to_date_v',
'options'=>array(
'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
)); ?>
<?php echo $form->error($model,'valid_to_date_v'); ?>
</div>
But anyway it’s not working for me also…
getting a error,
Object of class PsmsEmpInfoController could not be converted to string
can someone pls help?
Seems like a simple coding error.
<?php echo $form->labelEx($model,'This order valid till'); ?>
- <?php echo $form->$this->widget('zii.widgets.jui.CJuiDatePicker', array(
+ <?php echo $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'valid_to_date_v',
....
[EDIT]
The code above still had a simplest error.
The correct code should be without "echo" :
<?php echo $form->labelEx($model,'This order valid till'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'valid_to_date_v',
....
I did the changes as u told but now another error Object of class CJuiDatePicker could not be converted to string
earlier the error was Object of class PsmsEmpInfoController could not be converted to string
Does it has anything to do with ‘charset’ => ‘utf8’, inside my db config
'db'=>array(
'connectionString' => 'mysql:localhost;dbname=psms',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
No, I don’t think so.
I guess there’s a typo or something like that around the widget code.
Could you post the view code?
my view code
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'psms-order-skillitem-detail-order-form',
'enableAjaxValidation'=>false,
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'This order valid till'); ?>
<?php echo $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'valid_to_date_v',
'options'=>array(
'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
)); ?>
<?php echo $form->error($model,'valid_to_date_v'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Submit'); ?>
</div>
<?php $this->endWidget(); ?>
</div>
Should i use a before save option something like this??
public function beforeSave()
{
if ($this->valid_to_date_v == '') {
$this->setAttribute('valid_to_date_v', null);
} else {
$this->valid_to_date_v=date('Y-m-d', strtotime($this->valid_to_date_v));
}
return parent::beforeSave();
}
Oooops, I was wrong! The above is not correct. Sorry.
You don’t have to echo …
- <?php echo $this->widget('zii.widgets.jui.CJuiDatePicker', array(
+ <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
....
Cool… It started working… thanx a lot…
Hi…
Thanks… it worked for me also…
And can you suggest plz… how to change this for Timepicker…
Can someone help me the usage of themes?
i tried adding this lines to code…
but not working
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'valid_to_date_v',
'options'=>array(
'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
'themeUrl'=>$baseUrl.'/js/jquery-ui-themes-1.8/themes/ui-darkness/css',
'theme'=>'ui-darkness'
),
'htmlOptions'=>array(
'style'=>'height:20px;'
)
)); ?>
my ui-darkness theme folder is placed inside "\yii\framework\gii\assets\js"
is it the correct place to place it??
Finally done that also…
I refered this … but any other easiest solution for TimePicker… And also can any one suggest for file upload… Extension.
Thanks…
Hello…All
I want to use File upload extension…for a textfield… Any one plz help me… how to do so…
thanks…
hello…
i want to get value from jduttimepicker but i cann’t. why? may atribute don’t have value. it’s value always 1970/01/01 07:00:00 AM, can you all help me?
[font="Courier New"][/font]
Kiran, thank you very much, your code really works!!!!
hi,
how to used this extension in jalali date(persian calendar)?