prat
(Yurfriend19)
October 9, 2013, 9:27am
1
How can I use juidatetimepicker extension to select date time in form field. Currently I am doing it like this but it is giving me error.
<?php echo $form->textFieldRow($user,'expirationTime', $this->widget('ext.timepicker1.EJuiDateTimePicker',array(
'model'=>$user,
'attribute'=>'expirationTime',
'options'=>array(
'timeFormat'=>'HH:mm:ss',
'showSecond'=>true,
'hourGrid'=>4,
'minuteGrid'=>10,
),
'htmlOptions'=>array(
'class'=>'input-medium'
)
))); ?>
It is giving me following error Fatal error: Cannot use object of type EJuiDateTimePicker as array in C:\xampp\htdocs\DGMwebapp\protected\extensions\bootstrap\widgets\input\TbInput.php
prat:
How can I use juidatetimepicker extension to select date time in form field. Currently I am doing it like this but it is giving me error.
<?php echo $form->textFieldRow($user,'expirationTime', $this->widget('ext.timepicker1.EJuiDateTimePicker',array(
'model'=>$user,
'attribute'=>'expirationTime',
'options'=>array(
'timeFormat'=>'HH:mm:ss',
'showSecond'=>true,
'hourGrid'=>4,
'minuteGrid'=>10,
),
'htmlOptions'=>array(
'class'=>'input-medium'
)
))); ?>
It is giving me following error Fatal error: Cannot use object of type EJuiDateTimePicker as array in C:\xampp\htdocs\DGMwebapp\protected\extensions\bootstrap\widgets\input\TbInput.php
Hi,
Please try this code
$this->widget(‘application.extensions.timepicker.EJuiDateTimePicker’,array(
'model'=>$model,
'attribute'=>'begin',
'options'=>array(
'hourGrid' => 4,
'hourMin' => 6,
'hourMax' => 22,
'timeFormat' => 'h:mm',
'changeMonth' => true,
'changeYear' => false,
'timeOnlyTitle' => 'Starttime:',
'timeText' => 'time:',
'hourText' => 'hrs.',
'minuteText' => 'Min.',
// 'secondText' => 'Sec.',
'currentText' => 'Now',
'closeText' => 'Done',
),
'htmlOptions'=>array(
'value'=>$model->begin,
), // htmloptions
));
?>
Thanks
chandran nepolean
prat
(Yurfriend19)
October 10, 2013, 5:43am
3
Hello chandran thanks for your reply but I think you are just giving me various options of widget. I know all of these but how should I implement it in my form so that user can choose date using widget while filling form. In my post I had mentioned how I am trying to use widget and the error I am getting. So can you please tell how should I use it in my form and not the various options of widget. The error is due to how I am using the widget in my form.
Ankit_Modi
(Ankit Modi)
October 10, 2013, 7:40am
4
I think you can just remove the textfield
Hi,
You can just remove textFieldRow and just use this widget.
I saw in your code that you are binding this widget to textFieldRow.
This widget gives you textfield with option selecting time. I have used in my project.
Thanks
chandran nepolean
prat
(Yurfriend19)
October 10, 2013, 8:05am
6
thanks Maggie Q & chandran it is working now I just had to remove the textfieldrow.