Widget:ICSGenerator: Difference between revisions
Jump to navigation
Jump to search
m Fixed current date string |
m Small fix to the Time Zone |
||
(One intermediate revision by the same user not shown) | |||
Line 16: | Line 16: | ||
var d= new Date(); | var d= new Date(); | ||
var currentDateString = d.getFullYear() + ("0"+(d.getMonth()+1)).slice(-2) + ("0" + d.getDate()).slice(-2) + "T" | var currentDateString = d.getFullYear() + ("0"+(d.getMonth()+1)).slice(-2) + ("0" + d.getDate()).slice(-2) + "T" | ||
+ ("0" + d.getHours()).slice(-2) + ("0" + d.getMinutes()).slice(-2) + ("0" + d.getSeconds()).slice(-2); | |||
var hash = cyrb53("" + name + start + end); | var hash = cyrb53("" + name + start + end); | ||
Line 27: | Line 27: | ||
icsContent += "DTSTAMP:" + currentDateString + "\r\n"; | icsContent += "DTSTAMP:" + currentDateString + "\r\n"; | ||
icsContent += "UID:" + hash + "\r\n"; | icsContent += "UID:" + hash + "\r\n"; | ||
icsContent += "DTSTART;TZID= | icsContent += "DTSTART;TZID=Etc/UTC:" + start + "\r\n"; | ||
icsContent += "DTEND;TZID= | icsContent += "DTEND;TZID=Etc/UTC:" + end + "\r\n"; | ||
icsContent += "SUMMARY:" + name + "\r\n"; | icsContent += "SUMMARY:" + name + "\r\n"; | ||
icsContent += "END:VEVENT\r\n"; | icsContent += "END:VEVENT\r\n"; |
Latest revision as of 18:53, 17 February 2022
Creates a download link for an ICS file (event date container).
Parameter | Description | Type | Status | |
---|---|---|---|---|
Title of the event | title | The general title of the event. This is the text that will be shown in a calendar. Keep it short.
| String | required |
Event start | start | The start date of the event.
| Date | required |
Event end | end | The ending of the event.
| Date | required |
Usage
See the widget's testcases:
Test with given full date definition | |
---|---|
Wiki code | {{#widget:ICSGenerator |title=Name of the event |start=20220218T194956 |end=20220218T195956}} |
Main version | |
Sandbox version | (no sandbox subpage) |
Test with short date definition | |
---|---|
Wiki code | {{#widget:ICSGenerator |title=Name of the event |start=20220218T194956 |end=20220218T195956}} |
Main version | |
Sandbox version | (no sandbox subpage) |
See also
The above documentation is transcluded from Widget:ICSGenerator/doc. (edit | history) |