From 1db06f4933a68006e9246eeea9c536f07623f024 Mon Sep 17 00:00:00 2001 From: Leonardo Colman Lopes Date: Sun, 31 Dec 2023 14:59:16 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20Detekt=20Complaints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonardo Colman Lopes --- .../br/com/colman/petals/statistics/component/Period.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/br/com/colman/petals/statistics/component/Period.kt b/app/src/main/kotlin/br/com/colman/petals/statistics/component/Period.kt index be0bbc78..ea232100 100644 --- a/app/src/main/kotlin/br/com/colman/petals/statistics/component/Period.kt +++ b/app/src/main/kotlin/br/com/colman/petals/statistics/component/Period.kt @@ -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 { @Composable @@ -17,7 +17,10 @@ sealed class Period(val days: Int) : Comparable { } } - 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)