From: defacer Date: Mon, 3 May 2004 15:26:55 +0000 (+0000) Subject: L10n fixes and a bug fix... at least I _hope_ they were fixes... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e70fdac090b9ccd5ff3447f8c894050574b17bff;p=moodle.git L10n fixes and a bug fix... at least I _hope_ they were fixes... --- diff --git a/calendar/lib.php b/calendar/lib.php index 4a897fd693..0a9bede6fa 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -166,7 +166,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y $popupcontent .= '
id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'
'; } - $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('<<', 'view.php?id='.$data['id'].'&', 0, $prevmonth, $prevyear); $content .= ''; $content .= '\n"; - $content .= '\n"; + $content .= '\n"; $content .= '\n"; $content .= '
'.$prevlink."'.$monthname.' '.$data['y']."'.strftime(get_string('strftimemonthyear'), $time)."'.$nextlink."
'; 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 .= "\n"; $content .= '\n"; $content .= '\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(); diff --git a/lang/en/moodle.php b/lang/en/moodle.php index f53ab691ae..6af99e11d7 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -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';
<< '.strftime(get_string('strftimemonthyear'), $prevdate)."'.strftime(get_string('strftimemonthyear'), $time)."