BankingClient/multiplatform-utils/src/nativeMain/kotlin/net.dankito.utils.multiplat.../DateFormatter.kt

31 lines
952 B
Kotlin
Raw Normal View History

2022-02-12 23:19:00 +00:00
package net.dankito.utils.multiplatform
import kotlinx.datetime.*
import net.dankito.utils.multiplatform.extensions.toLocalDateTime
2022-02-12 23:19:00 +00:00
actual class DateFormatter actual constructor(pattern: String) {
actual constructor(dateStyle: DateFormatStyle) : this("")
2022-02-12 23:19:00 +00:00
actual constructor(dateStyle: DateFormatStyle, timeStyle: DateFormatStyle) : this("")
2022-02-12 23:19:00 +00:00
actual fun format(date: LocalDate): String {
return format(date.toLocalDateTime())
}
2022-02-12 23:19:00 +00:00
// TODO: implement for Logger, get current time formatted as string
actual fun format(date: LocalDateTime): String {
return "" // is only used in rare cases, don't implement right now
}
actual fun parseDate(dateString: String): LocalDate? {
return null // is only used in rare cases, don't implement right now
}
actual fun parse(dateString: String): LocalDateTime? {
return null // is only used in rare cases, don't implement right now
}
}