Skip to content

Commit

Permalink
fix(#50): format duration as years/months or days as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Jun 21, 2020
1 parent fa6a082 commit 9a93de4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ class TaxaFilterFragment : Fragment() {

val formatDuration: (Int) -> String = {
when {
(it >= 365) -> context.resources.getQuantityString(
(it % 365 == 0) -> context.resources.getQuantityString(
R.plurals.duration_year,
(it / 365),
(it / 365)
)
(it >= 30) -> context.resources.getQuantityString(
(it % 30 == 0) -> context.resources.getQuantityString(
R.plurals.duration_month,
(it / 30),
(it / 30)
Expand Down

0 comments on commit 9a93de4

Please sign in to comment.