Skip to content

Conversation

@randohinn
Copy link

@randohinn randohinn commented Feb 13, 2022

This PR adds the ability to add ?ics=true to the end of any calendar URL and get an iCalendar formatted feed generated and returned back. This is useful as the plugin can provide this link to both single and grouped calendars, making mass-sharing of grouped calendars much easier.

Welcome to feedback and/or changes needed to better structure this. So far, I have tested this on the site of JCI Estonia with a grouped calendar of 11 individual calendars and over 100 events successfully.

Copy link
Member

@rosinghal rosinghal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randohinn let me start by apologising for the delay in checking. Thanks so much for submitting this PR.

if(strpos($ics, $event->uid) == false) {
$ics .= "BEGIN:VEVENT\r\n";
$ics .="UID:" . $event->uid . "\r\n";
$ics .="DTSTAMP:" . $event->start_dt->format('Ymd\THis') . "\r\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the timings are not matching, maybe because of timezone

Screenshot 2023-03-20 at 8 37 03 AM

(purple is ICS export and yellow is Google calendar)

$ics .= "DTSTART:" . $event->start_dt->format('Ymd\THis') . "\r\n";
$ics .= "DTEND:" . $event->end_dt->format('Ymd\THis') . "\r\n";
$ics.= "SUMMARY:" . format_ical_string($event->title) . "\r\n";
$ics .= "DESCRIPTION:" . format_ical_string($event->description) . "\r\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would nice to check if the description is present, if not we can skip adding the description.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for LOCATION and GEO.

$content = '<strong>' . '[title]' . '</strong>';
$content .= "\n\n";
$content .= '[when]' . "\n";
$content .= '[when]' . "\r\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these changes for?

}
}

public function simcal_ics_action() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the formatting, a tab is missing.

@github-actions
Copy link

This pull request has been marked as stale due to inactivity. It will be closed in 30 days if no further updates are made.

@github-actions github-actions bot added the stale label Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants