Yii Framework Forum: yii-user profile fields - Yii Framework Forum

Jump to content

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

yii-user profile fields internationalisation, uwjuidate widget parameter

#1 User is offline   twinni 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 14-December 10

Posted 09 January 2011 - 11:31 AM

I've some trouble using the yii-user extension with proper internationalisation.
The default profile table includes a column 'birthday' with a 'Date' datatyp.

The yii-user extension generates a login and a update profile form using this field.
Unfortunately this is alway formatted with 'yyyy-mm-dd' and not taking care for the
language set in the configuration ('language' => 'de') to format the date to 'dd.mm.yyyy'.

Is internationalisation not implemented or am I missing some information on how to use it?

Second problem with this field is the usage of UWjuidate which calls the juidatepicker.
It ist possible to set some parameters like {"ui-theme":"redmond","language":"de"}.
The language should derived from the locale->language to allow applications using
multiple languages.

Something else what seems to be useful is using the "changeMonth: true, changeYear: true" options
to easyily select a year and month. But I don't now how to pass this parmeters to this widget. Any
help is welcome.

#2 User is offline   ibiz4 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 26-November 10
  • Location:Indonesia

Posted 22 February 2011 - 10:13 PM

look at the code:
<?php echo UserModule::t('JSON string (example: {example}).',array('{example}'=>CJavaScript::jsonEncode(array('param1'=>array('val1','val2'),'param2'=>array('k1'=>'v1','k2'=>'v2'))))); ?>

JSON string (example: {"param1":["val1","val2"],"param2":{"k1":"v1","k2":"v2"}})
(What Yii Serve is What You Get)

#3 User is offline   Julio 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 24-February 11

Posted 24 February 2011 - 12:51 PM

I had a similar problem with this widget on this extension. I wanted to use the field for a Birthday field, but the extension is set to display by default the today date, without letting the user change the year directly.

I realized that the widget used is Jquery (google it)

So, I modified this code to add year modification options in UWjuidate class on ./modules/user/components/UWjuidate.php line 61, as follows:

$options['dateFormat'] = 'yy-mm-dd';
$options['changeMonth'] = true; //added by me to support month changing
$options['changeYear'] = true; //added by me to support year changing

You could do the same for your date format.

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