diff --git a/.gitignore b/.gitignore index b1dff0d..16ba9fd 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,5 @@ bin/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store +.idea \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 7dbaad0..a143c3c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "2.0.21" + kotlin("jvm") version "2.2.0" } group = "com.survivalcoding" @@ -17,5 +17,5 @@ tasks.test { useJUnitPlatform() } kotlin { - jvmToolchain(17) + jvmToolchain(21) } \ No newline at end of file diff --git a/src/main/kotlin/YukymController.kt b/src/main/kotlin/YukymController.kt index cd4bba7..e22d89a 100644 --- a/src/main/kotlin/YukymController.kt +++ b/src/main/kotlin/YukymController.kt @@ -5,7 +5,7 @@ import java.time.format.DateTimeFormatter class YukymController { - val nowDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-mm-dd")) + val nowDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) // 날짜 형식 수정 lateinit var nowTime: String @@ -36,16 +36,17 @@ class YukymController { val nowTime = LocalDateTime.now() when { - nowTime.hour >= 0 || nowTime.hour < 2 -> return timeDataOne.first().ty1 - nowTime.hour >= 4 || nowTime.hour < 6 -> return timeDataOne.first().ty2 - nowTime.hour >= 6 || nowTime.hour < 8 -> return timeDataOne.first().ty3 - nowTime.hour >= 8 || nowTime.hour < 10 -> return timeDataOne.first().ty4 - nowTime.hour >= 10 || nowTime.hour < 12 -> return timeDataOne.first().ty5 - nowTime.hour >= 12 || nowTime.hour < 14 -> return timeDataOne.first().ty6 - nowTime.hour >= 16 || nowTime.hour < 18 -> return timeDataOne.first().ty7 - nowTime.hour >= 18 || nowTime.hour < 20 -> return timeDataOne.first().ty8 - nowTime.hour >= 20 || nowTime.hour < 22 -> return timeDataOne.first().ty9 - nowTime.hour >= 22 || nowTime.hour < 24 -> return timeDataOne.first().ty10 + // 조건문 오류 수정 + nowTime.hour >= 0 && nowTime.hour < 2 -> return timeDataOne.first().ty1 + nowTime.hour >= 4 && nowTime.hour < 6 -> return timeDataOne.first().ty2 + nowTime.hour >= 6 && nowTime.hour < 8 -> return timeDataOne.first().ty3 + nowTime.hour >= 8 && nowTime.hour < 10 -> return timeDataOne.first().ty4 + nowTime.hour >= 10 && nowTime.hour < 12 -> return timeDataOne.first().ty5 + nowTime.hour >= 12 && nowTime.hour < 14 -> return timeDataOne.first().ty6 + nowTime.hour >= 16 && nowTime.hour < 18 -> return timeDataOne.first().ty7 + nowTime.hour >= 18 && nowTime.hour < 20 -> return timeDataOne.first().ty8 + nowTime.hour >= 20 && nowTime.hour < 22 -> return timeDataOne.first().ty9 + nowTime.hour >= 22 && nowTime.hour < 24 -> return timeDataOne.first().ty10 } return result