Could remove unused date time extensions

This commit is contained in:
dankito 2024-09-03 21:35:50 +02:00
parent 469ee275c9
commit f17c9bb781
3 changed files with 0 additions and 48 deletions

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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")