Skip to content

Commit 1caf735

Browse files
committed
Reset the string representation for Time values having an hour > 23.
1 parent 6f7af11 commit 1caf735

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/rdf/model/literal/time.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def initialize(value, datatype: nil, lexical: nil, **options)
3939
end
4040
# Normalize 24:00:00 to 00:00:00
4141
hr, mi, se = tm.split(':')
42-
hr = "%.2i" % (hr.to_i % 24) if hr.to_i > 23
42+
if hr.to_i > 23
43+
hr = "%.2i" % (hr.to_i % 24)
44+
@string = nil
45+
end
4346
value = "#{hr}:#{mi}:#{se}"
4447
# Normalize to 1972-12-31 dateTime base
4548
::DateTime.parse("1972-12-31T#{hr}:#{mi}:#{se}#{@zone}")

0 commit comments

Comments
 (0)