]> git.mjollnir.org Git - moodle.git/commitdiff
L10n fixes and a bug fix... at least I _hope_ they were fixes...
authordefacer <defacer>
Mon, 3 May 2004 15:26:55 +0000 (15:26 +0000)
committerdefacer <defacer>
Mon, 3 May 2004 15:26:55 +0000 (15:26 +0000)
calendar/lib.php
lang/en/moodle.php

index 4a897fd693370b2a95e19ac52ba92c63ffd084a5..0a9bede6fa7d327ecbb9f3ac41c1a71501b49924 100644 (file)
@@ -166,7 +166,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
                 $popupcontent .= '<div><a href=\\\''.CALENDAR_URL.'view.php?view=event&amp;id='.$events[$eventid]->id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'</a></div>';
             }
 
-            $popupcaption = get_string('eventsfor', 'calendar', calendar_month_name(intval($date['mon'])).' '.$day);
+            $popupcaption = get_string('eventsfor', 'calendar', strftime(get_string('strftimedayshort'), usertime($events[$eventid]->timestart)));
             $popup = 'onmouseover="return overlib(\''.$popupcontent.'\', CAPTION, \''.$popupcaption.'\');" onmouseout="return nd();"';
 
             // Class and cell content
@@ -483,11 +483,10 @@ function calendar_top_controls($type, $data) {
     if(!isset($data['d'])) {
         $data['d'] = 1;
     }
-    $time = calendar_mktime_check($data['m'], $data['d'], $data['y']);
-    $date = getdate($time);
+    $time = calendar_gmmktime_check($data['m'], $data['d'], $data['y']);
+    $date = getdate(usertime($time));
     $data['m'] = $date['mon'];
     $data['y'] = $date['year'];
-    $monthname = calendar_month_name($date['month']);
 
     switch($type) {
         case 'frontpage':
@@ -508,7 +507,7 @@ function calendar_top_controls($type, $data) {
             $prevlink = calendar_get_link_tag('&lt;&lt;', 'view.php?id='.$data['id'].'&amp;', 0, $prevmonth, $prevyear);
             $content .= '<table class="generaltable" style="width: 100%;"><tr>';
             $content .= '<td style="text-align: left; width: 12%;">'.$prevlink."</td>\n";
-            $content .= '<td style="text-align: center;"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month&amp;', 1, $data['m'], $data['y']).'">'.$monthname.' '.$data['y']."</a></td>\n";
+            $content .= '<td style="text-align: center;"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month&amp;', 1, $data['m'], $data['y']).'">'.strftime(get_string('strftimemonthyear'), $time)."</a></td>\n";
             $content .= '<td style="text-align: right; width: 12%;">'.$nextlink."</td>\n";
             $content .= '</tr></table>';
         break;
@@ -535,8 +534,8 @@ function calendar_top_controls($type, $data) {
         case 'month':
             list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']);
             list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']);
-            $prevdate = calendar_mktime_check($prevmonth, 1, $prevyear);
-            $nextdate = calendar_mktime_check($nextmonth, 1, $nextyear);
+            $prevdate = calendar_gmmktime_check($prevmonth, 1, $prevyear);
+            $nextdate = calendar_gmmktime_check($nextmonth, 1, $nextyear);
             $content .= "<table style='width: 100%;'><tr>\n";
             $content .= '<td style="text-align: left; width: 30%;"><a href="'.calendar_get_link_href('view.php?view=month&amp;', 1, $prevmonth, $prevyear).'">&lt;&lt; '.strftime(get_string('strftimemonthyear'), $prevdate)."</a></td>\n";
             $content .= '<td style="text-align: center"><strong>'.strftime(get_string('strftimemonthyear'), $time)."</strong></td>\n";
@@ -649,16 +648,15 @@ function calendar_day_representation($tstamp, $now = false, $usecommonwords = tr
 
     static $shortformat;
     if(empty($shortformat)) {
-        $shortformat = strtolower(get_string('strftimedateshort'));
+        $shortformat = get_string('strftimedayshort');
     }
 
-    $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, $shortformat);
+    $formal = userdate($tstamp, $shortformat);
 
     // Reverse TZ compensation: make GMT stamps correspond to user's TZ
     $tzfix = calendar_get_tz_offset();
index f53ab691ae57eba95a33117328eedab0ff38f52c..6af99e11d7e6a64d033c114f82606b9e625f23e9 100644 (file)
@@ -818,6 +818,7 @@ $string['strftimedateshort'] = '%%d %%B';
 $string['strftimedatetime'] = '%%d %%B %%Y, %%I:%%M %%p';
 $string['strftimedaydate'] = '%%A, %%d %%B %%Y';
 $string['strftimedaydatetime'] = '%%A, %%d %%B %%Y, %%I:%%M %%p';
+$string['strftimedayshort'] = '%%A %%B %%d';
 $string['strftimemonthyear'] = '%%B %%Y';
 $string['strftimerecent'] = '%%d %%b, %%H:%%M';
 $string['strftimerecentfull'] = '%%a, %%d %%b %%Y, %%I:%%M %%p';