I want to create an ical/ics event feed from our collection of 'Single Calendar Event' assets.
I am sooo close, but the final 5% looks like taking way longer than I'd like, so, I'm looking for the lazy option - stealing - I mean, building upon, someone else's work!
So, the first question is: has anyone got a kick-a** example they'd be willing to share? :-)
Failing that, has anyone got some ideas to help me with these issues.
My first problem is devising a method of altering the output of the VEVENT depending on whether:
- it is a full day event, or a specific timed event
- an end date, or time has been specified
The ical format is quite picky about this stuff, so it'd be nice to get it right.
As an alternative to DTEND, I'd really like to use the DURATION: attribute based on the %event_duration% keyword, but I can't find the keyword modifiers I need to make that work. Any ideas there? I could go into some massive regex I suppose, but ewww! I'll probably end up using conditional keywords in a paint layout unless someone has a better idea.
My next problem is timezones! Why, oh why are my events getting advanced 10 hours?
DTSTART;TZID="Canberra, Melbourne, Sydney":%event_start_date^date_format:Ymd%T%event_start_time_24h^date_format:His%
on an event with no time specified (eg: an all day event) is becoming an event at 10am…
DTSTART;TZID="Canberra, Melbourne, Sydney":20160223T100000
Events with times specified are coming in correctly.
Just to pre-empt the inevitable "why not just use %event_start_date_ical%?". That keyword doesn't include a time unless one is specified, so, most calendar clients won't process the feed without an extra attribute for the DTSTART, even then, I've had difficulties. I'd need to do the conditional stuff some other way if I used that.