If a field is set to use the site's timezone the icalendar file is output with the wrong timezone.

In one example we have a site with a timezone set to "America/Phoenix", i.e Arizona. AZ is seven hours behind UTC, so noon UTC is 5am. A field is configured to use the site's timezone, i.e. the "tz_handling" value on the field's configuration is "site". A value in the database as e.g. "2015-03-30T21:00:00" and then shown as 2pm, March 30th, 2015 in the node edit form. This is all correct. However, when the node is loaded via the ical module the date is output as "DTSTART:TZID=America/Phoenix:20150330T210000" - it uses the UTC time but indicates the date is America/Phoenix. What should happen is that it either outputs the date as UTC or localizes the date and indicates the timezone, so it should be either "DTSTART:20150330T210000Z" or "DTSTART:TZID=America/Phoenix:20150330T140000".

CommentFileSizeAuthor
#1 ical-n2463713-1.patch1.83 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.83 KB

This patch checks if the field's configuration is set to use the site's timezone, if so it uses the "timezone_db" value from field instance instead of the "timezone" when creating the date value.

DamienMcKenna’s picture

This patch is for consideration. There are probably other issues I'm not aware of, other scenarios or other considerations, but for our specific scenario the patch resolves the problem.