mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix the custom repeat interval
This commit is contained in:
@@ -20,9 +20,15 @@ data class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var
|
|||||||
DAY -> currStart.plusDays(1)
|
DAY -> currStart.plusDays(1)
|
||||||
WEEK -> currStart.plusWeeks(1)
|
WEEK -> currStart.plusWeeks(1)
|
||||||
BIWEEK -> currStart.plusWeeks(2)
|
BIWEEK -> currStart.plusWeeks(2)
|
||||||
MONTH -> currStart.plusMonths(1)
|
else -> {
|
||||||
YEAR -> currStart.plusYears(1)
|
if (repeatInterval % YEAR == 0) {
|
||||||
else -> currStart.plusSeconds(repeatInterval)
|
currStart.plusYears(repeatInterval / YEAR)
|
||||||
|
} else if (repeatInterval % MONTH == 0) {
|
||||||
|
currStart.plusMonths(repeatInterval / MONTH)
|
||||||
|
} else {
|
||||||
|
currStart.plusSeconds(repeatInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val newStartTS = newStart.seconds()
|
val newStartTS = newStart.seconds()
|
||||||
val newEndTS = newStartTS + (endTS - startTS)
|
val newEndTS = newStartTS + (endTS - startTS)
|
||||||
|
Reference in New Issue
Block a user