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:
Jetha Chan 2014-12-15 09:27:04 +08:00
parent 8f06fffbe1
commit 08a4f93f1b

View File

@ -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;
}