]> git.mjollnir.org Git - moodle.git/commitdiff
Small change to better respect the lang file date settings. Should be objectively
authordefacer <defacer>
Thu, 29 Apr 2004 07:50:12 +0000 (07:50 +0000)
committerdefacer <defacer>
Thu, 29 Apr 2004 07:50:12 +0000 (07:50 +0000)
"better" now. See http://moodle.org/mod/forum/discuss.php?d=7450 for the issue.

calendar/lib.php

index 9d1b0d96950e58c25af195d2e63541cc7ae8bc52..407ca1624748b05737d62545ed90683fe3ec590f 100644 (file)
@@ -638,13 +638,18 @@ function calendar_filter_controls($type) {
 
 function calendar_day_representation($tstamp, $now = false, $usecommonwords = true) {
 
+    static $shortformat;
+    if(empty($shortformat)) {
+        $shortformat = strtolower(get_string('strftimedateshort'));
+    }
+
     $days = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
     if($now === false) {
         $now = time();
     }
 
     // To have it in one place, if a change is needed
-    $formal = get_string($days[userdate($tstamp, '%w')], 'calendar') . userdate($tstamp,' %d %b');
+    $formal = get_string($days[userdate($tstamp, '%w')], 'calendar') . userdate($tstamp, $shortformat);
 
     // Reverse TZ compensation: make GMT stamps correspond to user's TZ
     $tzfix = calendar_get_tz_offset();