Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICS download fails in Safari on events without time set. #83

Open
RuthAdele opened this issue Nov 25, 2015 · 0 comments
Open

ICS download fails in Safari on events without time set. #83

RuthAdele opened this issue Nov 25, 2015 · 0 comments

Comments

@RuthAdele
Copy link
Contributor

I discovered today that if an event has no Start Time and/or End Time set (i.e. it goes all day), then the START_TIMESTAMP and END_TIMESTAMP end with a T, which causes the ICS download to fail in Safari.
I have written a very basic hack on my local copy as a quick fix (see below), but I thought you might want to come up with something a little nicer to fix the problem properly.

So in ICSLink() (line 127 of CalendarDateTime.php), I have used:
if ($this->obj('StartTime')->getValue()) {
$ics_start = $this->obj('StartDate')->Format('Ymd')."T".$this->obj('StartTime')->Format('His');
}
else {
$ics_start = $this->obj('StartDate')->Format('Ymd');
}
if($this->EndDate) {

if ($this->obj('EndTime')->getValue()) {
    $ics_end = $this->obj('EndDate')->Format('Ymd')."T".$this->obj('EndTime')->Format('His'); 
}
else {
    $ics_end = $this->obj('EndDate')->Format('Ymd'); 
}

}
else {
$ics_end = $ics_start;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant