diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-09 09:22:53 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-09-07 09:44:14 +0900 |
commit | cbdde8e0c574f19e170c3de05dd0bbd276acb741 (patch) | |
tree | 503a42ff4e6ea3a5e8281e90f4e7f7c738bfd5e5 /ext/psych/lib/psych/scalar_scanner.rb | |
parent | bfa6d0f6d75f375e4055fb7f5af8194aa1de5947 (diff) |
[ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as Time
Fix ruby/psych#572
https://github.com/ruby/psych/commit/92304269bc
Diffstat (limited to 'ext/psych/lib/psych/scalar_scanner.rb')
-rw-r--r-- | ext/psych/lib/psych/scalar_scanner.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index b50667c315..3cb4bf3c7e 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -63,7 +63,7 @@ module Psych elsif string.match?(/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/) require 'date' begin - class_loader.date.strptime(string, '%Y-%m-%d') + class_loader.date.strptime(string, '%F', Date::GREGORIAN) rescue ArgumentError string end |