mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix dates and timezones
parent
5fb5e52e54
commit
f33e1a0ae0
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue