dax
(Daniela)
November 5, 2025, 5:55pm
1
Overview
When clicking “Add to calendar” in the event preview modal (the one that appears after clicking on the event’s date), the downloaded .ics file is named undefined.ics and the event title inside the calendar file is also set to SUMMARY:undefined. However, downloading the calendar via the “Add to calendar” option from the event’s 3-dot menu works as expected, using the event’s title for both the filename and the calendar summary.
Steps to reproduce
Create or open a topic with an event
Click on the event date shown in the post to expand the preview modal:
In the modal, click on Add to calendar
Save the generated .ics file.
Optionally, compare by clicking on the event’s 3-dot menu and using Add to calendar from there
Expected results
The downloaded .ics file should be named after the event’s title
The calendar file content should have a correct SUMMARY: with the event title
Observed results
The downloaded file is named undefined.ics
The event title in the calendar file is SUMMARY:undefined
(When downloaded from the 3-dot menu, both filename and summary are correct.)
Additional context
Tested on Meta and several other Discourse sites, same result.
3 Likes
sam
(Sam Saffron)
November 6, 2025, 1:24am
3
This is a tricky one Dax which is a side effect of our pipeline.
We generate the bbcode for the dates here:
get datesBBCode() {
const dates = [];
const startDate = this.buildDateBBCode({
date: this.startsAt,
format: this.startsAtFormat,
range: !!this.endsAt && "from",
});
dates.push(startDate);
if (this.endsAt) {
const endDate = this.buildDateBBCode({
date: this.endsAt,
format: this.endsAtFormat,
range: "to",
});
dates.push(endDate);
}
This file has been truncated. show original
And cook it here:
So in the context of the cooked chunk of html the “download ics” is not aware of the actual post it is on (or event)
We also have a different pipeline for ics generation at:
So we need to decide from an engineering perspective if:
We teach the “date cooking” how to re-route ics generation to Discourse Calendar.
OR
We provide enough context to Discourse Local Dates, so it can independently generate the ics and keep the code fractured.
I am not sure what the correct thing is to do here, but I have prioritized it so the team can triage and sort it out.
5 Likes
Ric
(Ric Harvey)
November 6, 2025, 1:45pm
5
Hi both to add some context, if you click on the three dots on an event there is a Add to Calendar option and this does work. I don’t know if that can help you look into this but seems it’s been solved elsewhere in the code.
edit: Of course @dax said this but I didn’t read properly!
6 Likes
sam
(Sam Saffron)
November 7, 2025, 5:13am
7
There is A LOT here:
main ← cal-ics
opened 10:14PM - 06 Nov 25 UTC
Our "Download to calendar" button in local dates needed more guidance from
disco… urse calendar ics is not generated by the calendar plugin
It is Friday (at least somewhere ;p ) so I will wait till Monday to merge.
This change is incredibly extensive and should give us significantly better ICS support.
Unifies the pipeline for ICS generation - we only use one mechanism for both add to calendar and clicking on dates
Corrects many small bits of nuance in the ics format
We pass on RRULE so if you grab a recurring event
Proper CRLF line breaks and general adherence to ICS format
Timezone support so when you grab an ICS for an event it will signal the correct timezone vs be a UTC event - this means recurrence will work.
Expands the local dates format to support an optionally encoded ics
An open question I have is yes, rrule or no, rrule .
If you click here:
Do we intend to add the recurring event? Or just a single instance of the event?
Similarly, what about here:
@lindsey I am on the fence here, I can see this argued either way.
I clicked on a recurring event and wanted to add the recurrence to my calendar
OR
I clicked on an INSTANCE of a recurrence and only want to add it.
I implemented (1) cause I tend to feel it is more correct, but I am open to changing it to 2 if you prefer.
7 Likes
nat
(Natalie T)
Split this topic
November 7, 2025, 8:22am
8
lindsey
(Lindsey Fogle)
November 7, 2025, 2:42pm
10
sam:
I clicked on a recurring event and wanted to add the recurrence to my calendar
I can understand the argument in either direction but I also prefer 1. I think it’s both more correct, and easier to “fix” if it wasn’t what the user wanted, because most calendar softwares make it quite easy to delete extra events with a single action (such as Google Calendar):
So the hassle of:
I didn’t want to RSVP to all events, so I need to remove the extra ones
Is much lower than the hassle of:
I did want to RSVP to all events, so I need to come back here each week and make sure to keep adding them to my calendar
5 Likes
sam
(Sam Saffron)
November 10, 2025, 4:06am
11
Cool I went ahead and kept the RSVP to all.
It was merged today
5 Likes
sam
(Sam Saffron)
Closed
November 14, 2025, 9:00pm
12
This topic was automatically closed after 4 days. New replies are no longer allowed.