Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -193,14 +193,16 @@ |
194 | 194 | ); |
195 | 195 | |
196 | 196 | if ( $user->getRegistration() ) { |
| 197 | + $displayUser = $context->getUser(); |
| 198 | + $userRegistration = $user->getRegistration(); |
197 | 199 | $defaultPreferences['registrationdate'] = array( |
198 | 200 | 'type' => 'info', |
199 | 201 | 'label-message' => 'prefs-registration', |
200 | 202 | 'default' => $context->msg( |
201 | 203 | 'prefs-registration-date-time', |
202 | | - $lang->timeanddate( $user->getRegistration(), true ), |
203 | | - $lang->date( $user->getRegistration(), true ), |
204 | | - $lang->time( $user->getRegistration(), true ) |
| 204 | + $lang->userTimeAndDate( $userRegistration, $displayUser ), |
| 205 | + $lang->userDate( $userRegistration, $displayUser ), |
| 206 | + $lang->userTime( $userRegistration, $displayUser ) |
205 | 207 | )->parse(), |
206 | 208 | 'section' => 'personal/info', |
207 | 209 | ); |
— | — | @@ -368,9 +370,11 @@ |
369 | 371 | // date and time are separate parameters to facilitate localisation. |
370 | 372 | // $time is kept for backward compat reasons. |
371 | 373 | // 'emailauthenticated' is also used in SpecialConfirmemail.php |
372 | | - $time = $lang->timeAndDate( $user->getEmailAuthenticationTimestamp(), true ); |
373 | | - $d = $lang->date( $user->getEmailAuthenticationTimestamp(), true ); |
374 | | - $t = $lang->time( $user->getEmailAuthenticationTimestamp(), true ); |
| 374 | + $displayUser = $context->getUser(); |
| 375 | + $emailTimestamp = $user->getEmailAuthenticationTimestamp(); |
| 376 | + $time = $lang->userTimeAndDate( $emailTimestamp, $displayUser ); |
| 377 | + $d = $lang->userDate( $emailTimestamp, $displayUser ); |
| 378 | + $t = $lang->userTime( $emailTimestamp, $displayUser ); |
375 | 379 | $emailauthenticated = $context->msg( 'emailauthenticated', |
376 | 380 | $time, $d, $t )->parse() . '<br />'; |
377 | 381 | $disableEmailPrefs = false; |
— | — | @@ -1094,7 +1098,8 @@ |
1095 | 1099 | * @return array |
1096 | 1100 | */ |
1097 | 1101 | static function getDateOptions( IContextSource $context ) { |
1098 | | - $dateopts = $context->getLanguage()->getDatePreferences(); |
| 1102 | + $lang = $context->getLanguage(); |
| 1103 | + $dateopts = $lang->getDatePreferences(); |
1099 | 1104 | |
1100 | 1105 | $ret = array(); |
1101 | 1106 | |
— | — | @@ -1115,7 +1120,7 @@ |
1116 | 1121 | if ( $key == 'default' ) { |
1117 | 1122 | $formatted = $context->msg( 'datedefault' )->escaped(); |
1118 | 1123 | } else { |
1119 | | - $formatted = htmlspecialchars( $context->getLanguage()->timeanddate( $epoch, false, $key ) ); |
| 1124 | + $formatted = htmlspecialchars( $lang->timeanddate( $epoch, false, $key ) ); |
1120 | 1125 | } |
1121 | 1126 | $ret[$formatted] = $key; |
1122 | 1127 | } |