@@ -321,18 +321,17 @@ function incDay(/*int*/$days=1) {
321321 */
322322 function preprocessFormatString ($ format ) {
323323 global $ i18n ;
324- if (isset ($ GLOBALS ['i18n ' ])) {
325- // replace locale-dependent strings
326- $ format = str_replace ('%a ' , mb_substr ($ i18n ->getWeekDayName ($ this ->mDay ), 0 , 3 , 'utf-8 ' ), $ format );
327- $ format = str_replace ('%A ' , $ i18n ->getWeekDayName ($ this ->mDay ), $ format );
328- $ abbrev_month = mb_substr ($ i18n ->monthNames [$ this ->mMonth ], 0 , 3 , 'utf-8 ' );
329- $ format = str_replace ('%b ' , $ abbrev_month , $ format );
330- $ format = str_replace ('%h ' , $ abbrev_month , $ format );
331- $ format = str_replace ('%z ' , date ('O ' ), $ format );
332- $ format = str_replace ('%Z ' , date ('O ' ), $ format ); // format as 'O' for consistency with JS strftime
333- if (strpos ($ format , '%c ' ) !== false ) {
334- $ format = str_replace ('%c ' , $ this ->preprocessFormatString ('%a %d %b %Y %T %Z ' ), $ format );
335- }
324+
325+ // replace locale-dependent strings
326+ $ format = str_replace ('%a ' , mb_substr ($ i18n ->getWeekDayName ($ this ->mDay ), 0 , 3 , 'utf-8 ' ), $ format );
327+ $ format = str_replace ('%A ' , $ i18n ->getWeekDayName ($ this ->mDay ), $ format );
328+ $ abbrev_month = mb_substr ($ i18n ->monthNames [$ this ->mMonth ], 0 , 3 , 'utf-8 ' );
329+ $ format = str_replace ('%b ' , $ abbrev_month , $ format );
330+ $ format = str_replace ('%h ' , $ abbrev_month , $ format );
331+ $ format = str_replace ('%z ' , date ('O ' ), $ format );
332+ $ format = str_replace ('%Z ' , date ('O ' ), $ format ); // format as 'O' for consistency with JS strftime
333+ if (strpos ($ format , '%c ' ) !== false ) {
334+ $ format = str_replace ('%c ' , $ this ->preprocessFormatString ('%a %d %b %Y %T %Z ' ), $ format );
336335 }
337336 return $ format ;
338337 }
0 commit comments