Fix for bug 1624:

Events that span more than one month now have their duration shown correctly in
each day of all subsequent months. For some reason I didn't quite figure out,
this happened till now only on events that spanned at least THREE months. Whatever...

Also, removed a small unused part of a global statement in view.php.
This commit is contained in:
defacer
2004-07-09 13:39:34 +00:00
parent d1e7c848f4
commit ef618501bb
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -843,7 +843,7 @@ function calendar_events_by_day($events, $month, $year, &$eventsbyday, &$duratio
$enddate = usergetdate($event->timestart + $event->timeduration);
// Simple arithmetic: $year * 13 + $month is a distinct integer for each distinct ($year, $month) pair
if(!($startdate['year'] * 13 + $startdate['mon'] >= $year * 13 + $month) && ($enddate['year'] * 13 + $enddate['mon'] <= $year * 13 + $month)) {
if(!($startdate['year'] * 13 + $startdate['mon'] <= $year * 13 + $month) && ($enddate['year'] * 13 + $enddate['mon'] >= $year * 13 + $month)) {
// Out of bounds
continue;
}
@@ -875,7 +875,7 @@ function calendar_events_by_day($events, $month, $year, &$eventsbyday, &$duratio
}
// The event starts on $month $year or before. So...
$lowerbound = $startdate['mon'] == $month && $startdate['year'] == $year ? intval($startdate['mday']) : 1;
$lowerbound = $startdate['mon'] == $month && $startdate['year'] == $year ? intval($startdate['mday']) : 0;
// Also, it ends on $month $year or later...
$upperbound = $enddate['mon'] == $month && $enddate['year'] == $year ? intval($enddate['mday']) : calendar_days_in_month($month, $year);
+1 -1
View File
@@ -183,7 +183,7 @@
function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
global $CFG, $THEME, $USER, $db;
global $CFG, $THEME, $USER;
if (!checkdate($m, $d, $y)) {
$now = usergetdate(time());