Affects Version/s: 2.7.5, 2.8.3
Fix Version/s: None
- Ensure the local (default) timezone is different from UTC.
- Go to Calendar, click Manage Subscriptions.
- Import events from lib/tests/fixtures/zimbra_allday.ics.
- On the calendar, ensure that "Test all-day event" is created on February 12 2015.
The event should start at midnight. Before applying the patch, the start time is in the wrong timezone.
vendor/bin/phpunit --filter core_calendar_ical_testcase::test_calendar_add_subscriptionManual steps: Ensure the local (default) timezone is different from UTC. Go to Calendar, click Manage Subscriptions. Import events from lib/tests/fixtures/zimbra_allday.ics. On the calendar, ensure that "Test all-day event" is created on February 12 2015. The event should start at midnight. Before applying the patch, the start time is in the wrong timezone. PHPunit testing: vendor/bin/phpunit --filter core_calendar_ical_testcase::test_calendar_add_subscription
Affected Branches:MOODLE_27_STABLE, MOODLE_28_STABLE
Pull from Repository:
Pull Master Branch:MDL-49197-floating-timezone
Pull Master Diff URL:
(I looked through the open Calendar issues and didn't see one that I thought matched this. Apologies if I missed one and this is a duplicate...)
Zimbra's iCal exporter creates all-day events with DTSTART and DTEND like this:
There is no X-WR-TIMEZONE in the file, so Moodle assumes UTC and interprets these values as midnight UTC, while we are in America/Vancouver (UTC-8). So our all-day events, when imported into Moodle, are showing up as lasting from 4pm to 4pm!
An easy fix for this specific case would be for calendar_add_icalendar_event to use local time as the default timezone, rather than UTC; but of course I don't know what else that might break. I guess a proper fix would be more along the lines of handling DATE values as independent of timezone.
Zimbra also emits X-MICROSOFT-CDO-ALLDAYEVENT:TRUE on these events; maybe that could be used?