1. Scott King
  2. Sherlock Holmes
  3. Bug report
  4. Wednesday, 12 March 2014
  5.  Subscribe via email
I have a site that is using the timezone America/Chicago (GMT-6) but now that we are in daylight savings, it's GMT-5. When I download a calendar file for an event, it's 6 hours later than it should be.

There were two problems. First, Matukio was retrieving the time for the ics file as GMT but the format of the time string was wrong. For GMT times to be interpreted properly by a program reading the ICS file, they need a "Z" at the end. For example:
DTSTART:20140326T193000Z
DTEND:20140326T213000Z


Another problem was that daylight savings time was not being interpreted properly. Using gmstrftime instead of strftime seems to fix the problem. Both fixes can be made to components/com_matukio/views/ics/tmpl/default.php. Replace lines 56, 57, and 58 with:

[code type=php]$icsdata .= "DTSTART:" . gmstrftime("%Y%m%dT%H%M%S", JFactory::getDate($event->begin)->toUnix()) . "Z\n";
$icsdata .= "DTEND:" . gmstrftime("%Y%m%dT%H%M%S", JFactory::getDate($event->end)->toUnix()) . "Z\n";
$icsdata .= "DTSTAMP:" . gmstrftime("%Y%m%dT%H%M%S", JFactory::getDate(MatukioHelperUtilsDate::getCurrentDate())->toUnix()) . "Z\n";[/code]
Responses (1)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now
Powered by EasyDiscuss for Joomla!