mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Avoid dummy_time_value to add "2000-01-01" twice
This commit is contained in:
parent
4687e59d5c
commit
589cef086f
1 changed files with 5 additions and 1 deletions
|
@ -29,7 +29,11 @@ module ActiveModel
|
|||
return value unless value.is_a?(::String)
|
||||
return if value.empty?
|
||||
|
||||
dummy_time_value = "2000-01-01 #{value}"
|
||||
if value =~ /^2000-01-01/
|
||||
dummy_time_value = value
|
||||
else
|
||||
dummy_time_value = "2000-01-01 #{value}"
|
||||
end
|
||||
|
||||
fast_string_to_time(dummy_time_value) || begin
|
||||
time_hash = ::Date._parse(dummy_time_value)
|
||||
|
|
Loading…
Reference in a new issue