Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions system/expressionengine/third_party/easy_ical/pi.easy_ical.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

class Easy_ical
{
const PI_VERSION = '1.1.1';
const PI_VERSION = '1.1.2';

function Easy_ical()
{
Expand Down Expand Up @@ -79,6 +79,19 @@ function calendar()

function event()
{
$start_stamp = (FALSE === $this->EE->TMPL->fetch_param('start_time_stamp')) ?
$this->ical_time($this->EE->TMPL->fetch_param('start_time')) :
$this->EE->TMPL->fetch_param('start_time_stamp');

$end_stamp = FALSE;

if(!$this->EE->TMPL->fetch_param('end_time_stamp') || !$this->EE->TMPL->fetch_param('end_time') ) {

$end_stamp = (FALSE === $this->EE->TMPL->fetch_param('end_time_stamp')) ?
$this->ical_time($this->EE->TMPL->fetch_param('end_time')) :
$this->EE->TMPL->fetch_param('end_time_stamp');
}

$out = "BEGIN:VEVENT\r\n".
"UID:".$this->escape($this->EE->TMPL->fetch_param('uid'))."\r\n";

Expand All @@ -87,12 +100,12 @@ function event()
$out .= "LOCATION:".$this->escape($this->EE->TMPL->fetch_param('location'))."\r\n";
}

$out .= "DTSTAMP:".$this->ical_time($this->EE->TMPL->fetch_param('start_time'))."\r\n";
$out .= "DTSTART:".$this->ical_time($this->EE->TMPL->fetch_param('start_time'))."\r\n";
$out .= "DTSTAMP:".$start_stamp."\r\n";
$out .= "DTSTART:".$start_stamp."\r\n";

if ($this->EE->TMPL->fetch_param('end_time') !== FALSE)
if ($end_stamp !== FALSE)
{
$out .= "DTEND:".$this->ical_time($this->EE->TMPL->fetch_param('end_time'))."\r\n";
$out .= "DTEND:".$end_stamp."\r\n";
}

if ($this->EE->TMPL->fetch_param('summary') !== FALSE)
Expand Down