From b8721fd4b5a593c3df99d376f232863d4e34d15b Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Thu, 19 Oct 2023 13:51:59 +1100 Subject: [PATCH] fix(llm/schedule): ensure starting and ending times are set --- drivers/place/llm/schedule.cr | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/place/llm/schedule.cr b/drivers/place/llm/schedule.cr index 42f57836ca..6f2a189793 100644 --- a/drivers/place/llm/schedule.cr +++ b/drivers/place/llm/schedule.cr @@ -233,11 +233,8 @@ class Place::Schedule < PlaceOS::Driver @[JSON::Field(converter: Time::EpochConverter, type: "integer", format: "Int64", ignore_serialize: true)] getter event_end : Time? - @[JSON::Field(ignore_deserialize: true)] - getter starting : Time { event_start.in(time_zone) } - - @[JSON::Field(ignore_deserialize: true)] - getter ending : Time? { event_end.try &.in(time_zone) } + getter starting : Time? + getter ending : Time? # these are used to configure the JSON times correctly @[JSON::Field(ignore_serialize: true)] @@ -248,8 +245,8 @@ class Place::Schedule < PlaceOS::Driver def configure_times(tz : Time::Location) @time_zone = tz - starting - ending + @starting = event_start.in(tz) + @ending = event_end.try &.in(tz) end end