fix #1039, fixing a weekly repetition glitch

This commit is contained in:
tibbi 2019-12-18 19:55:38 +01:00
parent af7ade1162
commit d379c22f0d
1 changed files with 3 additions and 3 deletions

View File

@ -150,9 +150,9 @@ data class Event(
// check if its the proper week, for events repeating every x weeks // check if its the proper week, for events repeating every x weeks
// get the week number since 1970, not just in the current year // get the week number since 1970, not just in the current year
fun isOnProperWeek(startTimes: LongSparseArray<Long>): Boolean { fun isOnProperWeek(startTimes: LongSparseArray<Long>): Boolean {
val initialWeekNumber = Formatter.getDateTimeFromTS(startTimes[id!!]!!).millis / (7 * 24 * 60 * 60 * 1000) val initialWeekNumber = Formatter.getDateTimeFromTS(startTimes[id!!]!!).millis / (7 * 24 * 60 * 60 * 1000f)
val currentWeekNumber = Formatter.getDateTimeFromTS(startTS).millis / (7 * 24 * 60 * 60 * 1000) val currentWeekNumber = Formatter.getDateTimeFromTS(startTS).millis / (7 * 24 * 60 * 60 * 1000f)
return (initialWeekNumber - currentWeekNumber) % (repeatInterval / WEEK) == 0L return (Math.round(initialWeekNumber) - Math.round(currentWeekNumber)) % (repeatInterval / WEEK) == 0
} }
fun updateIsPastEvent() { fun updateIsPastEvent() {