{namespace c=HDNET\Calendarize\ViewHelpers}
<f:if condition="{index}">
BEGIN:VEVENT
UID:calendarize-{index.slug}
DTSTAMP:{f:if(condition: index.tstamp, then: index.tstamp, else: 'now') -> c:dateTime.formatUtcDate(format: 'Ymd\THis\Z')}
<f:if condition="{index.allDay}">
    <f:then>
DTSTART;VALUE=DATE:<f:format.date format="Ymd" date="{index.startDateComplete}" />
DTEND;VALUE=DATE:<f:format.date format="Ymd" base="{index.endDateComplete}" date="+1 day" />
    </f:then>
    <f:else if="{index.openEndTime}">
DTSTART:<c:dateTime.formatUtcDate date="{index.startDateComplete}" format="Ymd\THis\Z" />
    </f:else>
    <f:else>
DTSTART:<c:dateTime.formatUtcDate date="{index.startDateComplete}" format="Ymd\THis\Z" />
DTEND:<c:dateTime.formatUtcDate date="{index.endDateComplete}" format="Ymd\THis\Z" />
    </f:else>
</f:if>
SUMMARY:{index.originalObject.feedTitle -> c:format.escapeIcalText()}
DESCRIPTION:{index.originalObject.feedAbstract -> f:format.stripTags() -> f:format.htmlentitiesDecode() -> c:format.escapeIcalText()}
X-ALT-DESC;FMTTYPE=text/html:{index.originalObject.feedAbstract -> c:format.escapeIcalText()}
LOCATION:{index.originalObject.feedLocation -> c:format.escapeIcalText()}
END:VEVENT
</f:if>