fix #256, add PRODID and VERSION to exported ics
This commit is contained in:
parent
9366e55b4a
commit
10b40f5b99
2 changed files with 4 additions and 0 deletions
|
@ -74,6 +74,8 @@ val FLAG_ALL_DAY = 1
|
|||
// constants related to ICS file exporting / importing
|
||||
val BEGIN_CALENDAR = "BEGIN:VCALENDAR"
|
||||
val END_CALENDAR = "END:VCALENDAR"
|
||||
val CALENDAR_PRODID = "PRODID:-//Simple Mobile Tools//NONSGML Event Calendar//EN"
|
||||
val CALENDAR_VERSION = "VERSION:2.0"
|
||||
val BEGIN_EVENT = "BEGIN:VEVENT"
|
||||
val END_EVENT = "END:VEVENT"
|
||||
val BEGIN_ALARM = "BEGIN:VALARM"
|
||||
|
|
|
@ -26,6 +26,8 @@ class IcsExporter {
|
|||
|
||||
it.bufferedWriter().use { out ->
|
||||
out.writeLn(BEGIN_CALENDAR)
|
||||
out.writeLn(CALENDAR_PRODID)
|
||||
out.writeLn(CALENDAR_VERSION)
|
||||
for (event in events) {
|
||||
out.writeLn(BEGIN_EVENT)
|
||||
event.title.replace("\n", "\\n").let { if (it.isNotEmpty()) out.writeLn("$SUMMARY:$it") }
|
||||
|
|
Loading…
Reference in a new issue