From 08a4f93f1b0854d4109b175d426d08545813f625 Mon Sep 17 00:00:00 2001 From: Jetha Chan Date: Mon, 15 Dec 2014 09:27:04 +0800 Subject: [PATCH] MDL-48088 calendar: normalize DTEND, add romance standard time Thanks to Cedric Mortiers (cmortiers@stjohns.be) for providing the patch. --- calendar/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/calendar/lib.php b/calendar/lib.php index 96aa0ce970a..39704f0fb79 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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; }