From f17c9bb781d8d95c43449b3d724e30f995d3b529 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 3 Sep 2024 21:35:50 +0200 Subject: [PATCH] Could remove unused date time extensions --- .../model/extensions/LocalDateExtensions.kt | 25 ------------------- .../extensions/LocalDateTimeExtensions.kt | 16 ------------ .../model/extensions/TimeZoneExtensions.kt | 7 ------ 3 files changed, 48 deletions(-) delete mode 100644 BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateExtensions.kt delete mode 100644 BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateTimeExtensions.kt delete mode 100644 BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/TimeZoneExtensions.kt diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateExtensions.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateExtensions.kt deleted file mode 100644 index d547cbc7..00000000 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateExtensions.kt +++ /dev/null @@ -1,25 +0,0 @@ -package net.codinux.banking.client.model.extensions - -import kotlinx.datetime.* -import kotlin.js.JsName - -val UnixEpochStart: LocalDate = LocalDate.parse("1970-01-01") - - -fun LocalDate.Companion.todayAtSystemDefaultTimeZone(): LocalDate { - return nowAt(TimeZone.currentSystemDefault()) -} - -fun LocalDate.Companion.todayAtEuropeBerlin(): LocalDate { - return nowAt(TimeZone.europeBerlin) -} - -@JsName("nowAtForDate") -fun LocalDate.Companion.nowAt(timeZone: TimeZone): LocalDate { - return Clock.System.todayIn(timeZone) -} - - -fun LocalDate.minusDays(days: Int): LocalDate { - return this.minus(days, DateTimeUnit.DAY) -} \ No newline at end of file diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateTimeExtensions.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateTimeExtensions.kt deleted file mode 100644 index b5d0d1a2..00000000 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/LocalDateTimeExtensions.kt +++ /dev/null @@ -1,16 +0,0 @@ -package net.codinux.banking.client.model.extensions - -import kotlinx.datetime.* - - -fun LocalDateTime.Companion.nowAtUtc(): LocalDateTime { - return nowAt(TimeZone.UTC) -} - -fun LocalDateTime.Companion.nowAtEuropeBerlin(): LocalDateTime { - return nowAt(TimeZone.europeBerlin) -} - -fun LocalDateTime.Companion.nowAt(timeZone: TimeZone): LocalDateTime { - return Clock.System.now().toLocalDateTime(timeZone) -} \ No newline at end of file diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/TimeZoneExtensions.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/TimeZoneExtensions.kt deleted file mode 100644 index 1da04e33..00000000 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/extensions/TimeZoneExtensions.kt +++ /dev/null @@ -1,7 +0,0 @@ -package net.codinux.banking.client.model.extensions - -import kotlinx.datetime.TimeZone - - -val TimeZone.Companion.europeBerlin: TimeZone - get() = TimeZone.of("Europe/Berlin") \ No newline at end of file