From 34b6939c18698fbee36d89f666e27d3f7e528ef8 Mon Sep 17 00:00:00 2001 From: Jimmy Tanagra Date: Sat, 7 Sep 2024 12:41:47 +1000 Subject: [PATCH] DateTimeType implements Java's Comparable in openHAB 4.3 Signed-off-by: Jimmy Tanagra --- lib/openhab/core/types/date_time_type.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/openhab/core/types/date_time_type.rb b/lib/openhab/core/types/date_time_type.rb index 391abe5d8..17efe4f98 100644 --- a/lib/openhab/core/types/date_time_type.rb +++ b/lib/openhab/core/types/date_time_type.rb @@ -18,7 +18,13 @@ class DateTimeType remove_method :== extend Forwardable - include Comparable + + # @deprecated OH 4.2 DateTimeType implements Java's Comparable interface in openHAB 4.3 + if OpenHAB::Core.version >= OpenHAB::Core::V4_3 + include ComparableType + else + include Comparable + end # # Regex expression to identify strings defining a time in hours, minutes and optionally seconds