Skip to content

Commit

Permalink
Fixed past dates crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
antonijzelinskij committed Oct 10, 2024
1 parent 9b568d5 commit de29966
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ fun Date.formatDateSinceEpoch(resourceManager: ResourceManager): String {
val currentDays = System.currentTimeMillis().daysFromMillis()
val diff = currentDays - time.daysFromMillis()

if (diff < 0) throw IllegalArgumentException("Past date should be less than current")
return when (diff) {
0L -> resourceManager.getString(R.string.today)
1L -> resourceManager.getString(R.string.yesterday)
Expand Down

0 comments on commit de29966

Please sign in to comment.