Changeset 3657
- Timestamp:
- 12/28/07 09:18:31 (11 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/date_time-duration/lib/date_time/duration.rb
r3656 r3657 50 50 months / 12 51 51 end 52 53 def self.new2 from, hash 54 duration = Hash.new(0) 55 duration[:months] = ( hash[:years] || 0 ) * 12 + ( hash[:months] || 0 ) 56 duration[:days] = Rational(( hash[:weeks] || 0 ) * 7 + ( hash[:days] || 0), 1) 57 duration[:seconds] = Rational( 58 ( hash[:hours] || 0 ) * 60 * 60 + ( hash[:minutes] || 0 ) * 60 + ( hash[:seconds] || 0 ), 24 * 60 * 60 59 ) 60 61 to = ( from + ( duration[:days] + duration[:seconds] ) ) >> duration[:months] 62 63 new(from, to) 64 end 52 65 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)