mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-48088 calendar: normalize DTEND, add romance standard time
Thanks to Cedric Mortiers (cmortiers@stjohns.be) for providing the patch.
This commit is contained in:
parent
8f06fffbe1
commit
08a4f93f1b
@ -1931,6 +1931,9 @@ function calendar_normalize_tz($tz) {
|
||||
case('Japan Standard Time'):
|
||||
$tz = 'Asia/Tokyo';
|
||||
break;
|
||||
case('Romance Standard Time'):
|
||||
$tz = 'Europe/Brussels';
|
||||
break;
|
||||
}
|
||||
return $tz;
|
||||
}
|
||||
@ -2971,6 +2974,7 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
|
||||
} else {
|
||||
$endtz = isset($event->properties['DTEND'][0]->parameters['TZID']) ? $event->properties['DTEND'][0]->parameters['TZID'] :
|
||||
$timezone;
|
||||
$endtz = calendar_normalize_tz($endtz);
|
||||
$eventrecord->timeduration = strtotime($event->properties['DTEND'][0]->value . ' ' . $endtz) - $eventrecord->timestart;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user