Skip to content

Commit

Permalink
Merge pull request #65 from nhorstmeier/ICSTimezoneBug
Browse files Browse the repository at this point in the history
Bugfix ICS Feed Timezone not adjusted
  • Loading branch information
unclecheese committed Oct 12, 2014
2 parents dd08d6b + efce1e6 commit 7435c0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ public function getFeedEvents($start_date, $end_date) {
// do nothing; dates outside range
} else {
$feedevent->StartDate = $startdatetime->format('Y-m-d');
$feedevent->StartTime = $startdatetime->format('G:i:s');
$feedevent->StartTime = $startdatetime->format('H:i:s');

$feedevent->EndDate = $enddatetime->format('Y-m-d');
$feedevent->EndTime = $enddatetime->format('G:i:s');
$feedevent->EndTime = $enddatetime->format('H:i:s');

$feedevents->push($feedevent);
}
Expand All @@ -381,9 +381,11 @@ public function getFeedEvents($start_date, $end_date) {
}

public function iCalDateToDateTime($date) {
date_default_timezone_set($this->stat('timezone'));
$date = str_replace('T', '', $date);//remove T
$date = str_replace('Z', '', $date);//remove Z
$date = strtotime($date);
$date = $date + date('Z');
return sfDate::getInstance($date);
}

Expand Down

0 comments on commit 7435c0b

Please sign in to comment.