mirror of
https://github.com/DreamExposure/DisCal-Discord-Bot.git
synced 2026-01-23 20:38:27 -06:00
Range command is now working correctly
This commit is contained in:
@@ -11,6 +11,7 @@ import reactor.core.publisher.Flux
|
||||
import reactor.core.publisher.Mono
|
||||
import reactor.function.TupleUtils
|
||||
import java.time.Instant
|
||||
import java.time.LocalDate
|
||||
import java.time.ZonedDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.format.DateTimeParseException
|
||||
@@ -152,9 +153,9 @@ class EventsCommand : SlashCommand {
|
||||
.map { it.asString() }
|
||||
.flatMap { value ->
|
||||
calMono.map {
|
||||
val formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd").withZone(it.timezone)
|
||||
val formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd")
|
||||
|
||||
ZonedDateTime.parse(value, formatter)
|
||||
LocalDate.parse(value, formatter).atStartOfDay(it.timezone)
|
||||
}
|
||||
}.map(ZonedDateTime::toInstant)
|
||||
|
||||
@@ -162,9 +163,10 @@ class EventsCommand : SlashCommand {
|
||||
.map { it.asString() }
|
||||
.flatMap { value ->
|
||||
calMono.map {
|
||||
val formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd").withZone(it.timezone)
|
||||
val formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd")
|
||||
|
||||
ZonedDateTime.parse(value, formatter)
|
||||
//At end of day
|
||||
LocalDate.parse(value, formatter).plusDays(1).atStartOfDay(it.timezone)
|
||||
}
|
||||
}.map(ZonedDateTime::toInstant)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user