Closed guger closed 5 years ago
What are the recurrence rules? This is probably a bug.
Just daily.
I didn't manage to reproduce your output. What was the start date of the recurrence and in what time zone?
@Test
fun testDailyRecurrences() {
val recurrence = Recurrence(LocalDate.now().minusDays(5).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(), Recurrence.DAILY)
val missedRecurrences = recurrence.findRecurrencesBetween(0, System.currentTimeMillis())
assertThat(missedRecurrences, notNullValue())
val nextRecurrence = recurrence.findRecurrences(System.currentTimeMillis().inc(), 1).first()
assertThat(nextRecurrence, notNullValue())
assertThat(missedRecurrences.size, `is`(5))
assertNotEquals("lastRecurrence: ${missedRecurrences.last()} - nextRecurrence $nextRecurrence", missedRecurrences.last(), nextRecurrence)
}
Thanks, I fixed it.
This is actually a kind of problem I feared would happen since the library was developed with more focus on UI than on the recurrence computation system, which should actually have been done by another library made for that. But I didn't find any at the time. So I made one that's "good enough", without a lot of testing, since recurring events is often a secondary feature in apps anyway.
Well, therefore I'm testing :)
Your libs are great, I'm using all three dialogs in my app now ;D
Why does
recurrence.findRecurrences(1558821600001, 1)
return1558821600000
?