Skip to content

Commit

Permalink
fix(llm/schedule): ensure starting and ending times are set
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Oct 19, 2023
1 parent 38a6459 commit b8721fd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/place/llm/schedule.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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

Expand Down

0 comments on commit b8721fd

Please sign in to comment.