From af377210fe24ddf158b464c286a4e2a07410a774 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 3 Apr 2017 21:04:42 +0200 Subject: [PATCH] limit events at ics with BEGIN:VEVENT and END:VEVENT --- .../com/simplemobiletools/calendar/helpers/IcsExporter.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt index 7e4a0f6a7..700d898f4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt @@ -15,8 +15,14 @@ class IcsExporter { var eventsFailed = 0 fun exportEvents(context: Context, path: String, events: ArrayList): ExportResult { - File(path, "events_${System.currentTimeMillis() / 1000}.ics").bufferedWriter().use { out -> + val filename = "events_${System.currentTimeMillis() / 1000}.ics" + File(path, filename).bufferedWriter().use { out -> out.writeLn(BEGIN_CALENDAR) + for (event in events) { + out.writeLn(BEGIN_EVENT) + + out.writeLn(END_EVENT) + } out.writeLn(END_CALENDAR) }