Skip to content

Commit

Permalink
Fix DateTimeType.parse spec (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtng authored Sep 14, 2024
1 parent cb4f7d6 commit de562b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/openhab/core/types/date_time_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@
end

it "parses time only strings with a timezone" do
local_date_time = LocalTime.parse("3:30").at_date(LocalDate.now)
expect(DateTimeType.parse("3:30+1000")).to eq local_date_time.at_zone(ZoneId.of("+1000"))
zone_id = ZoneId.of("+1000")
date_time_type = DateTimeType.parse("3:30+1000").to_zone(zone_id)
date_time = ZonedDateTime.now.with(LocalTime.parse("3:30")).with_zone_same_local(zone_id)
expect(date_time_type).to eq date_time
end
end
end

0 comments on commit de562b9

Please sign in to comment.