diff --git a/lib/openhab/core/types/date_time_type.rb b/lib/openhab/core/types/date_time_type.rb index 4c84459fa..d3b3874a4 100644 --- a/lib/openhab/core/types/date_time_type.rb +++ b/lib/openhab/core/types/date_time_type.rb @@ -193,6 +193,7 @@ def wday # # @return [String] The timezone in `[+-]hh:mm(:ss)` format (`Z` for UTC) # + # @deprecated This method has been deprecated in openHAB 4.3. def zone zoned_date_time.zone.id end diff --git a/spec/openhab/core/types/date_time_type_spec.rb b/spec/openhab/core/types/date_time_type_spec.rb index 3c03f176a..fc52475b4 100644 --- a/spec/openhab/core/types/date_time_type_spec.rb +++ b/spec/openhab/core/types/date_time_type_spec.rb @@ -26,7 +26,12 @@ specify { expect(date2.wday).to be 0 } specify { expect(date2).to be_utc } specify { expect(date2.month).to be 1 } - specify { expect(date2.zone).to eql "Z" } + + if OpenHAB::Core.version < OpenHAB::Core::V4_3 + specify { expect(date2.zone).to eql "Z" } + else + specify { expect(date2.zone).to eql "Etc/UTC" } + end end it "considers same time but different zone to be equal" do diff --git a/spec/openhab/core_ext/ephemeris_spec.rb b/spec/openhab/core_ext/ephemeris_spec.rb index c5920e515..5e0137c5d 100644 --- a/spec/openhab/core_ext/ephemeris_spec.rb +++ b/spec/openhab/core_ext/ephemeris_spec.rb @@ -17,7 +17,7 @@ end it "returns nil for a non-holiday" do - expect(LocalDate.parse("2022-12-26").holiday).to be_nil + expect(LocalDate.parse("2022-12-27").holiday).to be_nil end end