Skip to content

Commit

Permalink
Fix task showing "tomorrow" when its "today"
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed Sep 21, 2023
1 parent 0918776 commit d6a2c9e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ fun SubjectCard(
}
}

val Task.daysUntil get(): Long = (dueDate - Clock.System.now()).inWholeDays + 1
val Task.daysUntil get(): Long {
val difference = (dueDate - Clock.System.now())
val days = difference.inWholeDays
val hours = difference.inWholeHours
return if(hours < 0L) 0 else days + 1
}

0 comments on commit d6a2c9e

Please sign in to comment.