From c88d198add02874f480bea45c63465067f044f52 Mon Sep 17 00:00:00 2001 From: c-noblet Date: Wed, 15 Jan 2025 19:14:24 +0100 Subject: [PATCH] feat: add VTODO DUE tag support in IcsImporter --- .../main/kotlin/org/fossify/calendar/helpers/Constants.kt | 1 + .../main/kotlin/org/fossify/calendar/helpers/IcsImporter.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/kotlin/org/fossify/calendar/helpers/Constants.kt b/app/src/main/kotlin/org/fossify/calendar/helpers/Constants.kt index 7a6dd10c4..0524a6605 100644 --- a/app/src/main/kotlin/org/fossify/calendar/helpers/Constants.kt +++ b/app/src/main/kotlin/org/fossify/calendar/helpers/Constants.kt @@ -177,6 +177,7 @@ const val BEGIN_TASK = "BEGIN:VTODO" const val END_TASK = "END:VTODO" const val BEGIN_ALARM = "BEGIN:VALARM" const val END_ALARM = "END:VALARM" +const val DUE = "DUE" const val DTSTART = "DTSTART" const val DTEND = "DTEND" const val LAST_MODIFIED = "LAST-MODIFIED" diff --git a/app/src/main/kotlin/org/fossify/calendar/helpers/IcsImporter.kt b/app/src/main/kotlin/org/fossify/calendar/helpers/IcsImporter.kt index a4a8d8c11..6a6674691 100644 --- a/app/src/main/kotlin/org/fossify/calendar/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/org/fossify/calendar/helpers/IcsImporter.kt @@ -101,6 +101,12 @@ class IcsImporter(val activity: SimpleActivity) { curEventTypeId = defaultEventTypeId isParsingTask = true curType = TYPE_TASK + } else if (line.startsWith(DUE)) { + curStart = getTimestamp(line.substring(DUE.length)) + + if (curRrule != "") { + parseRepeatRule() + } } else if (line.startsWith(DTSTART)) { if (isParsingEvent || isParsingTask) { curStart = getTimestamp(line.substring(DTSTART.length))