Index: moodlelib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/moodlelib.php,v retrieving revision 1.960.2.119 diff -u -r1.960.2.119 moodlelib.php --- moodlelib.php 4 Mar 2009 14:59:45 -0000 1.960.2.119 +++ moodlelib.php 10 Mar 2009 18:04:58 -0000 @@ -1,4 +1,4 @@ -nofixday)) { // Config.php can force %d not to be fixed. $fixday = false; } else if ($fixday) { @@ -1237,7 +1243,7 @@ if (abs($timezone) > 13) { /// Server time if ($fixday) { $datestring = strftime($formatnoday, $date); - $daystring = str_replace(' 0', '', strftime(' %d', $date)); + $daystring = trim(str_replace(' 0', '', strftime(' %d', $date))); //Bug with leading space if day > 9 (dlnsk %%57%%) $datestring = str_replace('DD', $daystring, $datestring); } else { $datestring = strftime($format, $date); @@ -1246,22 +1252,32 @@ $date += (int)($timezone * 3600); if ($fixday) { $datestring = gmstrftime($formatnoday, $date); - $daystring = str_replace(' 0', '', gmstrftime(' %d', $date)); + $daystring = trim(str_replace(' 0', '', gmstrftime(' %d', $date))); // (dlnsk %%57%%) $datestring = str_replace('DD', $daystring, $datestring); } else { $datestring = gmstrftime($format, $date); } } + /// correcting dates (dlnsk) %%10%% + $str = get_string(strtolower(date('F', $date)), 'calendar'); // January + $datestring = str_replace('_=BB=_', $str, $datestring); + $str = get_string(strtolower(date('l', $date)), 'calendar'); // Monday + $datestring = str_replace('_=AA=_', $str, $datestring); + $str = get_string(strtolower(date('M', $date)), 'calendar'); // Jan + $datestring = str_replace('_=bb=_', $str, $datestring); + $str = get_string(strtolower(date('D', $date)), 'calendar'); // Mon + $datestring = str_replace('_=aa=_', $str, $datestring); + /// If we are running under Windows convert from windows encoding to UTF-8 /// (because it's impossible to specify UTF-8 to fetch locale info in Win32) - if ($CFG->ostype == 'WINDOWS') { - if ($localewincharset = get_string('localewincharset')) { - $textlib = textlib_get_instance(); - $datestring = $textlib->convert($datestring, $localewincharset, 'utf-8'); - } - } +// if ($CFG->ostype == 'WINDOWS') { // no need converting (dlnsk) +// if ($localewincharset = get_string('localewincharset')) { +// $textlib = textlib_get_instance(); +// $datestring = $textlib->convert($datestring, $localewincharset, 'utf-8'); +// } +// } return $datestring; }