Skip to content

Commit

Permalink
Fix Facebook event times.
Browse files Browse the repository at this point in the history
The events don't contain end dates anymore, resp. are returned as null. And the
start dates contain timezone information now.
  • Loading branch information
yunosh committed Mar 6, 2014
1 parent d79a189 commit 986d2b3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions timeobjects/lib/Driver/FacebookEvents.php
Expand Up @@ -50,16 +50,12 @@ public function listTimeObjects(Horde_Date $start = null, Horde_Date $time = nul
if ($data = $cache->get($key, 3600)) {
return json_decode($data, true);
}
$tz = $GLOBALS['prefs']->getValue('timezone');
if (empty($tz)) {
$tz = date_default_timezone_get();
}
$objects = array();
foreach ($events as $event) {
$start = new Horde_Date($event['start_time'], $tz);
$start->setTimezone('America/Los_Angeles');
$end = new Horde_Date($event['end_time'], $tz);
$end->setTimezone('America/Los_Angeles');
$start = new Horde_Date($event['start_time']);
$end = $event['end_time']
? new Horde_Date($event['end_time'])
: clone $start;
$title = $event['name'];
if (isset($event['tagline']) && strlen($event['tagline'])) {
$title .= ' - ' . $event['tagline'];
Expand Down

0 comments on commit 986d2b3

Please sign in to comment.