Skip to content

Commit

Permalink
fix: including all previous week task
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal2376 committed Apr 1, 2024
1 parent 735166d commit 250a58e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ fun ThisWeekTaskScreen(

val startDayOfWeek = WeekFields.of(DayOfWeek.MONDAY, 1).weekOfYear()
val currentWeek = LocalDate.now().get(startDayOfWeek)
val previousWeek = currentWeek - 1
val previousWeek = LocalDate.now().minusWeeks(1)

val thisWeekTasks = tasks.filter { task ->
val taskWeekOfYear = task.date.get(startDayOfWeek)
(taskWeekOfYear == currentWeek) || (taskWeekOfYear == previousWeek && task.isRepeated)
(taskWeekOfYear == currentWeek) || ((task.date in previousWeek..LocalDate.now()) && task.isRepeated)
}

Scaffold(topBar = {
Expand Down

0 comments on commit 250a58e

Please sign in to comment.