mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-46517 calendar: adjust display for DST
Thanks to Jo Matthews for providing a patch
This commit is contained in:
parent
91465b5095
commit
a0ef87de1f
2 changed files with 6 additions and 6 deletions
|
@ -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>»</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
|
||||
|
|
|
@ -498,9 +498,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue