[F] Fix dates and timezones

pull/111/head
Azalea 2025-01-18 22:03:07 -05:00
parent 5fb5e52e54
commit f33e1a0ae0
1 changed files with 2 additions and 2 deletions

View File

@ -193,8 +193,8 @@ fun Maimai2ServletController.initApis() {
val phases = mapOf(1 to 1, 2 to 7, 3 to 14, 4 to 21) val phases = mapOf(1 to 1, 2 to 7, 3 to 14, 4 to 21)
// Find the minimum phase id that started prior to today. // Find the minimum phase id that started prior to today.
fun findPhase(baseDate: LocalDate): Int { fun findPhase(baseDate: LocalDate): Int {
val today = LocalDate.now() val today = jstNow().toLocalDate()
return phases.entries.find { baseDate.plusDays(it.value.toLong()) >= today }?.key ?: 5 return phases.entries.find { baseDate.plusDays(it.value.toLong()) > today }?.key ?: 5
} }
// Kaleidoscope, added on 1.50 // Kaleidoscope, added on 1.50