Yii Framework Forum: Undefined Variable: Model_Nhuser - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Undefined Variable: Model_Nhuser Rate Topic: -----

#1 User is offline   Selvakumar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 92
  • Joined: 14-August 13

Posted 16 August 2013 - 04:02 AM

I have a standard date format as follows , and i need to store this date into the database...
please help me .. :(



$this->widget('zii.widgets.jui.CJuiDatePicker',array(

'model' => $model_NhUser,
'attribute' => "date_of_birth",
'name'=>'dob',
// additional javascript options for the date picker plugin
'options'=>array(
'dateFormat' => Yii::app()->params['date_format'],
'showAnim'=>'fold',
'yearRange'=>'-100:+0',
'changeMonth'=>'true',
'changeYear'=>'true',
),
'htmlOptions'=>array('size'=>20,'maxlength'=>20, 'height'=> 10, 'class'=>'in-area1', 'placeholder'=>'DD-MM-YYYY ', ),
));
?>
0

#2 User is offline   kalpit 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 02-August 13
  • Location:Bangalore

Posted 16 August 2013 - 04:46 AM

use yii::app()->dateValidator to change date formate :)
Thanks,
Kalpit Pandit
0

#3 User is offline   Selvakumar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 92
  • Joined: 14-August 13

Posted 16 August 2013 - 04:52 AM

View Postkalpit, on 16 August 2013 - 04:46 AM, said:

use yii::app()->dateValidator to change date formate :)

sorry, i want to store the date into the database...
0

#4 User is offline   kalpit 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 02-August 13
  • Location:Bangalore

Posted 16 August 2013 - 05:05 AM

for that you have run this query in your sql.

SELECT date_format(field_name,'%m/%d/%Y') as field_name FROM table_name


::)
Thanks,
Kalpit Pandit
0

#5 User is offline   Selvakumar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 92
  • Joined: 14-August 13

Posted 16 August 2013 - 05:43 AM

View Postkalpit, on 16 August 2013 - 05:05 AM, said:

for that you have run this query in your sql.

SELECT date_format(field_name,'%m/%d/%Y') as field_name FROM table_name


::)

thank u sir... its working... :)
0

#6 User is offline   kalpit 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 02-August 13
  • Location:Bangalore

Posted 16 August 2013 - 05:51 AM

View PostSelvakumar, on 16 August 2013 - 05:43 AM, said:

thank u sir... its working... :)



great Enjoy B)
Thanks,
Kalpit Pandit
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users