$popupcontent .= '<div><a href=\\\''.CALENDAR_URL.'view.php?view=event&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
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':
$prevlink = calendar_get_link_tag('<<', 'view.php?id='.$data['id'].'&', 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&', 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&', 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;
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&', 1, $prevmonth, $prevyear).'"><< '.strftime(get_string('strftimemonthyear'), $prevdate)."</a></td>\n";
$content .= '<td style="text-align: center"><strong>'.strftime(get_string('strftimemonthyear'), $time)."</strong></td>\n";
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();