Generate and download an ics file for calendar events.
Supports multi languages based on HTML language <html lang="en">
Create a link to the ics-event.js
file at the end of the HTML file
<script src="/src/ics-event.js"></script>
In .ics
file specify json-data file path
const jsonUrl = "../data/icsEventData.json";
Insert a link with id="downloadIcs
<a href="javascript:void(0)" id="downloadIcs">Download ics</a>
Add data to the icsEventData.json
file
{
"common": {
"startDate": "2024-03-19",
"startTime": "18:00:00",
"endDate": "2024-03-19",
"endTime": "22:30:00",
"status": "CONFIRMED"
},
"detailsIt": {
"title": "Titolo evento",
"description": "descrizione <a href=\"[url]\">link</a>",
"location": "Luogo",
"url": "[url]"
},
"detailsEn": {
"title": "Event title",
"description": "description <a href=\"[url]\">link</a>",
"location": "Location",
"url": "[url]"
}
}
"ORGANIZER;CN="+ commons.organizer.name + ":mailto:" + commons.organizer.email + "\n" +
Needs to add parameters in json file
"common": {
...
"organizer": {
"name": "John Doe",
"mail": "[email protected]"
}
},