Skip to content

Commit

Permalink
Change to Java Time
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Oct 14, 2024
1 parent b3d8c44 commit 9b5a28d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/kotlin/org/fuchss/matrix/mensa/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.readValue
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import kotlinx.datetime.LocalTime
import kotlinx.datetime.toJavaLocalTime
import net.folivo.trixnity.core.model.RoomId
import org.fuchss.matrix.bots.IConfig
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.File
import java.time.Instant
import java.time.LocalDate
import java.time.LocalTime
import java.time.ZoneId
import java.util.Date

Expand Down Expand Up @@ -72,7 +71,7 @@ data class Config(
* Get the next time of the next reminder (notification to [subscriptions]).
*/
fun nextReminder(): Date {
var nextUpdate = timeToSendUpdates.toJavaLocalTime().atDate(LocalDate.now()).atZone(ZoneId.systemDefault())
var nextUpdate = timeToSendUpdates.atDate(LocalDate.now()).atZone(ZoneId.systemDefault())
if (!nextUpdate.toInstant().isAfter(Instant.now())) {
// Else use tomorrow ..
nextUpdate = nextUpdate.plusDays(1)
Expand Down

0 comments on commit 9b5a28d

Please sign in to comment.