From bdb3404c3dc27e287a69ffb437e4a87ee28ac541 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Thu, 26 Sep 2024 17:59:45 +0200 Subject: [PATCH] Duration -> LocalDateTime in Twilight more appropriate for polar seasons --- src/main/java/eu/m724/wtapi/object/Twilight.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/m724/wtapi/object/Twilight.java b/src/main/java/eu/m724/wtapi/object/Twilight.java index ebc4e76..5ea3754 100644 --- a/src/main/java/eu/m724/wtapi/object/Twilight.java +++ b/src/main/java/eu/m724/wtapi/object/Twilight.java @@ -2,14 +2,15 @@ package eu.m724.wtapi.object; import java.time.Duration; import java.time.LocalDate; +import java.time.LocalDateTime; /** * @param date The date this object contains times for - * @param sunrise Time of sunrise relative to UTC midnight of the date - * @param sunset Time of sunset relative to UTC midnight of the date + * @param sunrise Time of sunrise + * @param sunset Time of sunset */ -public record Twilight(LocalDate date, Duration sunrise, Duration sunset) { +public record Twilight(LocalDate date, LocalDateTime sunrise, LocalDateTime sunset) { public Duration getDayLength() { - return sunset.minus(sunrise); + return Duration.between(sunrise, sunset); } }