Merge branch 'wip-MDL-46517-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE

This commit is contained in:
Damyon Wiese
2014-10-29 13:13:58 +08:00
2 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -318,9 +318,9 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
}
// Now display all the calendar
$daytime = $display->tstart - DAYSECS;
$daytime = strtotime('-1 day', $display->tstart);
for($day = 1; $day <= $display->maxdays; ++$day, ++$dayweek) {
$daytime += DAYSECS;
$daytime = strtotime('+1 day', $daytime);
if($dayweek > $display->maxwday) {
// We need to change week (table row)
$content .= '</tr><tr>';
@@ -932,8 +932,8 @@ function calendar_top_controls($type, $data) {
case 'day':
$days = calendar_get_days();
$prevtimestamp = $time - DAYSECS;
$nexttimestamp = $time + DAYSECS;
$prevtimestamp = strtotime('-1 day', $time);
$nexttimestamp = strtotime('+1 day', $time);
$prevdate = $calendartype->timestamp_to_date_array($prevtimestamp);
$nextdate = $calendartype->timestamp_to_date_array($nexttimestamp);
@@ -1679,7 +1679,7 @@ function calendar_format_event_time($event, $now, $linkparams = null, $usecommon
$timeend = calendar_time_representation($event->timestart + $event->timeduration);
// Set printable representation.
if ($now >= $usermidnightstart && $now < ($usermidnightstart + DAYSECS)) {
if ($now >= $usermidnightstart && $now < strtotime('+1 day', $usermidnightstart)) {
$url = calendar_get_link_href(new moodle_url(CALENDAR_URL . 'view.php', $linkparams), 0, 0, 0, $endtime);
$eventtime = $timestart . ' <strong>&raquo;</strong> ' . html_writer::link($url, $dayend) . $timeend;
} else {
@@ -2775,7 +2775,7 @@ class calendar_information {
* @return int tomorrow timestamp
*/
public function timestamp_tomorrow() {
return $this->time + DAYSECS;
return strtotime('+1 day', $this->time);
}
/**
* Adds the pretend blocks for the calendar
+2 -2
View File
@@ -503,9 +503,9 @@ class core_calendar_renderer extends plugin_renderer_base {
$weekend = intval($CFG->calendar_weekend);
}
$daytime = $display->tstart - DAYSECS;
$daytime = strtotime('-1 day', $display->tstart);
for ($day = 1; $day <= $display->maxdays; ++$day, ++$dayweek) {
$daytime = $daytime + DAYSECS;
$daytime = strtotime('+1 day', $daytime);
if($dayweek > $display->maxwday) {
// We need to change week (table row)
$table->data[] = $row;