X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FDateAndTime.class.php;h=20f274265a7762ca3c64b4865fe15c68b662e324;hb=75a1eedb8977b8f2db459128bab9aaf367e3b58b;hp=4752e99fc7411fa33e1d1354b53b7721b4ae64c7;hpb=cafeaa310010bf6d4a91f592e98227b89892a3c8;p=timetracker.git diff --git a/WEB-INF/lib/DateAndTime.class.php b/WEB-INF/lib/DateAndTime.class.php index 4752e99f..20f27426 100644 --- a/WEB-INF/lib/DateAndTime.class.php +++ b/WEB-INF/lib/DateAndTime.class.php @@ -321,18 +321,17 @@ class DateAndTime { */ function preprocessFormatString($format) { global $i18n; - if (isset($GLOBALS['i18n'])) { - // replace locale-dependent strings - $format = str_replace('%a', mb_substr($i18n->getWeekDayName($this->mDay), 0, 3, 'utf-8'), $format); - $format = str_replace('%A', $i18n->getWeekDayName($this->mDay), $format); - $abbrev_month = mb_substr($i18n->monthNames[$this->mMonth], 0, 3, 'utf-8'); - $format = str_replace('%b', $abbrev_month, $format); - $format = str_replace('%h', $abbrev_month, $format); - $format = str_replace('%z', date('O'), $format); - $format = str_replace('%Z', date('O'), $format); // format as 'O' for consistency with JS strftime - if (strpos($format, '%c') !== false) { - $format = str_replace('%c', $this->preprocessFormatString('%a %d %b %Y %T %Z'), $format); - } + + // replace locale-dependent strings + $format = str_replace('%a', mb_substr($i18n->getWeekDayName($this->mDay), 0, 3, 'utf-8'), $format); + $format = str_replace('%A', $i18n->getWeekDayName($this->mDay), $format); + $abbrev_month = mb_substr($i18n->monthNames[$this->mMonth], 0, 3, 'utf-8'); + $format = str_replace('%b', $abbrev_month, $format); + $format = str_replace('%h', $abbrev_month, $format); + $format = str_replace('%z', date('O'), $format); + $format = str_replace('%Z', date('O'), $format); // format as 'O' for consistency with JS strftime + if (strpos($format, '%c') !== false) { + $format = str_replace('%c', $this->preprocessFormatString('%a %d %b %Y %T %Z'), $format); } return $format; }