Permalink
Browse files

Applied 00a64be to lib/19/time.rb

  • Loading branch information...
1 parent 278fae6 commit 69ed6b84dc82c57106b7e30c964369c49db4b5f7 @brixen brixen committed Oct 23, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/19/time.rb
View
@@ -258,13 +258,13 @@ def make_time(year, mon, day, hour, min, sec, sec_fraction, zone, now)
#
def parse(date, now=self.now)
comp = !block_given?
- d = Date._parse(date, comp)
- if !d[:year] && !d[:mon] && !d[:mday] && !d[:hour] && !d[:min] && !d[:sec] && !d[:sec_fraction]
+ d = Date._parse(date, comp, true)
+ 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 = d.year
year = yield(year) if year && !comp
- make_time(year, d[:mon], d[:mday], d[:hour], d[:min], d[:sec], d[:sec_fraction], d[:zone], now)
+ make_time(year, d.mon, d.mday, d.hour, d.min, d.sec, d.sec_fraction, d.zone, now)
end
#

0 comments on commit 69ed6b8

Please sign in to comment.