diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/time.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/time.rb b/lib/time.rb index b8e3b22998..a10c20bedc 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -416,6 +416,9 @@ class Time force_zone!(t, zone) end else + if !d[:year] && !d[:mon] && !d[:mday] && !d[:hour] && !d[:min] && !d[:sec] && !d[:sec_fraction] + raise ArgumentError, "no time information in #{date.inspect}" + end year = d[:year] year = yield(year) if year && block_given? t = make_time(year, d[:mon], d[:mday], d[:hour], d[:min], d[:sec], d[:sec_fraction], d[:zone], now) |