Skip to content

Commit

Permalink
Bug #5991 - The calendar does not show the month's first day's event;…
Browse files Browse the repository at this point in the history
… merged from MOODLE_16_STABLE
  • Loading branch information
skodak committed Jul 3, 2006
1 parent 7eb60c2 commit d619890
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions calendar/lib.php
Expand Up @@ -104,9 +104,15 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
list($d, $m, $y) = array($date['mday'], $date['mon'], $date['year']); // This is what we want to display
$display->maxdays = calendar_days_in_month($m, $y);

// We 'll keep these values as GMT here, and offset them when the time comes to query the db
$display->tstart = gmmktime(0, 0, 0, $m, 1, $y); // This is GMT
$display->tend = gmmktime(23, 59, 59, $m, $display->maxdays, $y); // GMT
if (get_user_timezone_offset() < 99) {
// We 'll keep these values as GMT here, and offset them when the time comes to query the db
$display->tstart = gmmktime(0, 0, 0, $m, 1, $y); // This is GMT
$display->tend = gmmktime(23, 59, 59, $m, $display->maxdays, $y); // GMT
} else {
// no timezone info specified
$display->tstart = mktime(0, 0, 0, $m, 1, $y);
$display->tend = mktime(23, 59, 59, $m, $display->maxdays, $y);
}

$startwday = dayofweek(1, $m, $y);

Expand Down

0 comments on commit d619890

Please sign in to comment.