You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 ase.data.title
ande.title
however substituting either of those in such asdownload:e.title+".ics"
results in the filename being "undefined" and usingdownload:e.data.title+".ics"
(which was the one I thought would work) throws an error in the console: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.
The text was updated successfully, but these errors were encountered: