Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,9 @@ def rfc3339(time)
if RUBY_VERSION >= "3.2"
def _xmlschema(pattern, time) # :nodoc:
if pattern.match?(time)
new(time.strip)
time = time.strip
time.upcase!
new(time)
else
raise ArgumentError.new("invalid xmlschema format: #{time.inspect}")
end
Expand Down
2 changes: 2 additions & 0 deletions test/test_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def subtest_xmlschema(method)
Time.__send__(method, "2000-03-04T23:00:00+03:00"))
assert_equal(Time.utc(2000, 3, 4, 20, 0, 0),
Time.__send__(method, "2000-03-04T20:00:00Z"))
assert_equal(Time.utc(2000, 3, 4, 20, 0, 0),
Time.__send__(method, "2000-03-04t20:00:00z"))
assert_equal(Time.utc(2000, 1, 16, 12, 0, 0),
Time.__send__(method, "2000-01-16T12:00:00Z"))
assert_equal(Time.utc(1999, 12, 31, 23, 0, 0),
Expand Down