diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt index 0a444ef28..544e00e3d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt @@ -35,7 +35,7 @@ import java.text.SimpleDateFormat import java.util.* fun Context.updateWidgets() { - val widgetsCnt = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(this, MyWidgetMonthlyProvider::class.java)) + val widgetsCnt = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(applicationContext, MyWidgetMonthlyProvider::class.java)) if (widgetsCnt.isNotEmpty()) { val ids = intArrayOf(R.xml.widget_monthly_info) Intent(applicationContext, MyWidgetMonthlyProvider::class.java).apply { @@ -49,7 +49,7 @@ fun Context.updateWidgets() { } fun Context.updateListWidget() { - val widgetsCnt = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(this, MyWidgetListProvider::class.java)) + val widgetsCnt = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(applicationContext, MyWidgetListProvider::class.java)) if (widgetsCnt.isNotEmpty()) { val ids = intArrayOf(R.xml.widget_list_info) Intent(applicationContext, MyWidgetListProvider::class.java).apply { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt index 869d16a1b..7ccb280f0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt @@ -92,7 +92,11 @@ class IcsImporter { } else if (line.startsWith(LAST_MODIFIED)) { curLastModified = getTimestamp(line.substring(LAST_MODIFIED.length)) * 1000L } else if (line.startsWith(EXDATE)) { - curRepeatExceptions.add(getTimestamp(line.substring(EXDATE.length))) + var value = line.substring(EXDATE.length) + if (value.endsWith('}')) + value = value.substring(0, value.length - 1) + + curRepeatExceptions.add(getTimestamp(value)) } else if (line.startsWith(LOCATION)) { curLocation = line.substring(LOCATION.length) } else if (line == END_ALARM) {