mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix #911, fixing a glitch at trying to parse daylight at importing
This commit is contained in:
@@ -39,6 +39,7 @@ class IcsImporter(val activity: SimpleActivity) {
|
||||
private var isProperReminderAction = false
|
||||
private var isDescription = false
|
||||
private var isSequence = false
|
||||
private var isParsingEvent = false
|
||||
private var curReminderTriggerMinutes = REMINDER_OFF
|
||||
private var curReminderTriggerAction = REMINDER_NOTIFICATION
|
||||
private val eventsHelper = activity.eventsHelper
|
||||
@@ -83,8 +84,11 @@ class IcsImporter(val activity: SimpleActivity) {
|
||||
if (line == BEGIN_EVENT) {
|
||||
resetValues()
|
||||
curEventTypeId = defaultEventTypeId
|
||||
isParsingEvent = true
|
||||
} else if (line.startsWith(DTSTART)) {
|
||||
if (isParsingEvent) {
|
||||
curStart = getTimestamp(line.substring(DTSTART.length))
|
||||
}
|
||||
} else if (line.startsWith(DTEND)) {
|
||||
curEnd = getTimestamp(line.substring(DTEND.length))
|
||||
} else if (line.startsWith(DURATION)) {
|
||||
@@ -142,6 +146,7 @@ class IcsImporter(val activity: SimpleActivity) {
|
||||
curReminderActions.add(curReminderTriggerAction)
|
||||
}
|
||||
} else if (line == END_EVENT) {
|
||||
isParsingEvent = false
|
||||
if (curStart != -1L && curEnd == -1L) {
|
||||
curEnd = curStart
|
||||
}
|
||||
@@ -304,6 +309,7 @@ class IcsImporter(val activity: SimpleActivity) {
|
||||
isNotificationDescription = false
|
||||
isProperReminderAction = false
|
||||
isSequence = false
|
||||
isParsingEvent = false
|
||||
curReminderTriggerMinutes = REMINDER_OFF
|
||||
curReminderTriggerAction = REMINDER_NOTIFICATION
|
||||
}
|
||||
|
Reference in New Issue
Block a user