mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-03-10 08:20:05 +01:00
fix #256, add PRODID and VERSION to exported ics
This commit is contained in:
parent
9366e55b4a
commit
10b40f5b99
@ -74,6 +74,8 @@ val FLAG_ALL_DAY = 1
|
|||||||
// constants related to ICS file exporting / importing
|
// constants related to ICS file exporting / importing
|
||||||
val BEGIN_CALENDAR = "BEGIN:VCALENDAR"
|
val BEGIN_CALENDAR = "BEGIN:VCALENDAR"
|
||||||
val END_CALENDAR = "END: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 BEGIN_EVENT = "BEGIN:VEVENT"
|
||||||
val END_EVENT = "END:VEVENT"
|
val END_EVENT = "END:VEVENT"
|
||||||
val BEGIN_ALARM = "BEGIN:VALARM"
|
val BEGIN_ALARM = "BEGIN:VALARM"
|
||||||
|
@ -26,6 +26,8 @@ class IcsExporter {
|
|||||||
|
|
||||||
it.bufferedWriter().use { out ->
|
it.bufferedWriter().use { out ->
|
||||||
out.writeLn(BEGIN_CALENDAR)
|
out.writeLn(BEGIN_CALENDAR)
|
||||||
|
out.writeLn(CALENDAR_PRODID)
|
||||||
|
out.writeLn(CALENDAR_VERSION)
|
||||||
for (event in events) {
|
for (event in events) {
|
||||||
out.writeLn(BEGIN_EVENT)
|
out.writeLn(BEGIN_EVENT)
|
||||||
event.title.replace("\n", "\\n").let { if (it.isNotEmpty()) out.writeLn("$SUMMARY:$it") }
|
event.title.replace("\n", "\\n").let { if (it.isNotEmpty()) out.writeLn("$SUMMARY:$it") }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user