Skip to content

Commit

Permalink
🚨 Fix Detekt Complaints
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Dec 31, 2023
1 parent 4f844be commit 1db06f4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import br.com.colman.petals.R.plurals.last_x_days
import br.com.colman.petals.R.string.today
import java.time.LocalDate
import me.moallemi.tools.daterange.localdate.LocalDateRange
import java.time.LocalDate

sealed class Period(val days: Int) : Comparable<Period> {
@Composable
Expand All @@ -17,7 +17,10 @@ sealed class Period(val days: Int) : Comparable<Period> {
}
}

fun toDateRange(end: LocalDate = LocalDate.now()) = LocalDateRange(end.minusDays((if(days == 0) 0 else days + 1).toLong()), end)
fun toDateRange(end: LocalDate = LocalDate.now()) = LocalDateRange(
end.minusDays((if (days == 0) 0 else days + 1).toLong()),
end
)

override fun compareTo(other: Period): Int = compareValues(days, other.days)

Expand Down

0 comments on commit 1db06f4

Please sign in to comment.