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

Unique ics filename #23

Open
rvew opened this issue Aug 16, 2021 · 0 comments
Open

Unique ics filename #23

rvew opened this issue Aug 16, 2021 · 0 comments

Comments

@rvew
Copy link

rvew commented Aug 16, 2021

Just to start off with, thanks for maintaining this, I've found adding a simple way to export events to calendars excruciatingly overcomplicated for what seems to good reason.

Have tinkered with and adapted for my needs quite substantially and like how easy it was to do with this, and using the minified file it doesn't add much to my site either.

What I'd like to do though is have the .ics filename to be the name of the event, my site will have multiple events and this would make life easier for users downloading multiple events at once (especially if they have older events still in their download directory, on say their mobile where they may not think of clearing them out).

I can see early on in the "add-to-calendar.min.js" file the ics filename is designated download:"Calendar-event.ics" and I can change this here for any static name I desire. However I'd like to pipe the event title in, I see further down the file this referred to as e.data.title and e.title however substituting either of those in such as download:e.title+".ics" results in the filename being "undefined" and using download:e.data.title+".ics" (which was the one I thought would work) throws an error in the console:

Uncaught TypeError: Cannot read property 'title' of undefined at add-to-calendar.min.js:1

My JS isn't all that great (as you can probably tell so far) and I'm guessing that the e.title used further down is after some parsing of the passed two object array, which is why I thought e.data.title would work, as it's the title item in the data object from the passed array.

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