From e8cc65c3f907a6af5403ececd3dd1785e181bec1 Mon Sep 17 00:00:00 2001 From: nvllz Date: Sun, 21 Jan 2024 20:06:13 +0100 Subject: [PATCH] detekt fix #1 --- .../src/main/java/com/ivy/legacy/data/model/TimePeriod.kt | 4 +++- .../com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/temp-legacy-code/src/main/java/com/ivy/legacy/data/model/TimePeriod.kt b/temp-legacy-code/src/main/java/com/ivy/legacy/data/model/TimePeriod.kt index 66c13c3eeb..c0d54340ef 100644 --- a/temp-legacy-code/src/main/java/com/ivy/legacy/data/model/TimePeriod.kt +++ b/temp-legacy-code/src/main/java/com/ivy/legacy/data/model/TimePeriod.kt @@ -12,6 +12,8 @@ import com.ivy.legacy.utils.withDayOfMonthSafe import java.time.LocalDate import java.time.LocalDateTime +private const val MONTH_NAME_ABBREVIATION_LENGTH = 3 + @Immutable data class TimePeriod( val month: Month? = null, @@ -169,7 +171,7 @@ data class TimePeriod( val year = year return if (year != null && dateNowUTC().year != year) { // not this year - "${month.name.substring(0, 3)}, $year" + "${month.name.substring(0, MONTH_NAME_ABBREVIATION_LENGTH)}, $year" } else { // this year month.name diff --git a/temp-legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt b/temp-legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt index dc4634dbd9..ce396f53b6 100644 --- a/temp-legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt +++ b/temp-legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.material3.Text import androidx.compose.runtime.Composable