From 6fc01ad285aec0b71da413857478f8b019c087ee Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 25 Aug 2024 02:37:14 +0200 Subject: [PATCH] Fixed dependencies without FinTs4kBankingClient --- composeApp/build.gradle.kts | 3 +++ .../kotlin/net/codinux/banking/ui/service/FormatUtil.kt | 7 +++++-- gradle/libs.versions.toml | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index bba510f..95e5764 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -11,6 +11,7 @@ plugins { alias(libs.plugins.compose.compiler) } + kotlin { @OptIn(ExperimentalWasmDsl::class) wasmJs { @@ -54,6 +55,8 @@ kotlin { val desktopMain by getting commonMain.dependencies { + implementation(libs.banking.client.model) + implementation(libs.kcsv) implementation(libs.klf) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt index 40c3eb7..3e0ec19 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt @@ -4,12 +4,11 @@ import androidx.compose.ui.graphics.Color import kotlinx.datetime.LocalDate import kotlinx.datetime.Month import net.codinux.banking.client.model.Amount -import net.codinux.banking.fints.extensions.toStringWithMinDigits class FormatUtil { fun formatDate(date: LocalDate): String = // TODO: find a better way - "${date.dayOfMonth.toStringWithMinDigits(2)}.${date.monthNumber.toStringWithMinDigits(2)}.${date.year.toString().substring(2)}" + "${minDigits(date.dayOfMonth, 2)}.${minDigits(date.monthNumber, 2)}.${date.year.toString().substring(2)}" fun formatMonth(date: LocalDate): String = // TODO: find a better way "${getMonthName(date.month)} ${date.year}" @@ -48,4 +47,8 @@ class FormatUtil { else -> Color.Green } + + fun minDigits(toConvert: Int, minDigits: Int): String = + toConvert.toString().padStart(minDigits, '0') + } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 08e469b..d3d0ff2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,6 +2,8 @@ kotlin = "2.0.10" kotlinx-coroutines = "1.8.1" +banking-client = "0.5.1-SNAPSHOT" + kcsv = "2.1.1" klf = "1.5.1" @@ -22,6 +24,8 @@ compose-plugin = "1.6.11" junit = "4.13.2" [libraries] +banking-client-model = { group = "net.codinux.banking.client", name = "banking-client-model", version.ref = "banking-client" } + kcsv = { group = "net.codinux.csv", name = "kcsv", version.ref = "kcsv" } klf = { group = "net.codinux.log", name = "kmp-log", version.ref = "klf" }