Use java.time instead of kotlinx-datetime

This commit is contained in:
Username404 2021-06-19 20:29:36 +02:00
parent 8e0848a497
commit 1aa4c374d1
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 2 additions and 7 deletions

View File

@ -62,7 +62,6 @@ subprojects {
implementation("$kotlinX:kotlinx-serialization-core:$serializationVer")
implementation("$kotlinX:kotlinx-serialization-json:$serializationVer")
listOf(
"$kotlinX:kotlinx-datetime-jvm:0.2.1",
"com.typesafe:config:1.4.1",
"io.github.config4k:config4k:0.4.2",
"com.github.Vatuu:discord-rpc:1.6.2"
@ -79,7 +78,6 @@ subprojects {
}
withType(ShadowJar::class) {
this.configurations = listOf(shadowC)
relocate("kotlinx.datetime", "${rootProject.group}.datetime")
relocate("javassist", "${rootProject.group}.javassist")
relocate("org.reflections8", "${rootProject.group}.reflectionlib")
relocate("com.typesafe.config", "${rootProject.group}.typesafe.config")

View File

@ -3,14 +3,11 @@ package fr.username404.snowygui.gui.feature
import com.mojang.blaze3d.vertex.PoseStack
import fr.username404.snowygui.Snowy.Companion.onEvent
import fr.username404.snowygui.gui.FontUtil
import kotlinx.datetime.Clock as DatetimeClock
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
import java.time.LocalDateTime
@ButtonInfo(Category.MISC)
object Clock: ButtonImpl() {
private val currentTimezone = TimeZone.currentSystemDefault()
override fun toString(): String = DatetimeClock.System.now().toLocalDateTime(currentTimezone).run {
override fun toString(): String = LocalDateTime.now().run {
arrayOf(hour, minute, second).map {
(it.takeIf { (it >= 10) } ?: "0$it").toString()
}.reduce { previous, current -> "$previous:$current"}