Read a due without a time on its own date in the Up Next widget (#101)

This commit is contained in:
makiolaj committed 2026-11-20 18:07:11 +01:00
1 parent 12dd6b2dec
commit efa71cdb3c
2 files changed
+23 -3

No files matched your search

@@ -109,6 +109,13 @@ class WidgetStatsTest {
assertThat(upcoming(open, now, today, newYork).map { it.taskId }).containsExactly(2L, 1L).inOrder()
}
@Test
fun `a date without a time counts days from its own date, not from UTC midnight`() {
// Noon in New York; UTC midnight of the 23rd is still the 22nd there.
assertThat(daysFromToday(allDayInstantOf(LocalDate.of(2026, 7, 23)), now, newYork)).isEqualTo(3L)
assertThat(daysFromToday(allDayInstantOf(LocalDate.of(2026, 7, 19)), now, newYork)).isEqualTo(-1L)
}
@Test
fun `upcoming is empty when nothing is dated`() {
assertThat(upcoming(listOf(testTask(due = null)), now, today, newYork)).isEmpty()