Skip to content

Commit

Permalink
do not use DateTimeZone.forOffsetHoursMinutes() since it can be probl…
Browse files Browse the repository at this point in the history
…ematic in non-latest joda-time

* also, Ruby handles division of a negative in a way not conforming to this usage
  • Loading branch information
eregon committed Sep 20, 2013
1 parent 02aee5a commit 186665e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/ruby/1.9/date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,8 @@ def _valid_time? (h, min, s) # :nodoc:
def chronology(sg, of=0)
tz = if of == 0
JODA::DateTimeZone::UTC
elsif of = of * 1440 and Rational === of and of.denominator == 1
of = of.numerator
h, m = of.divmod(60)
JODA::DateTimeZone.forOffsetHoursMinutes(h, m)
else
JODA::DateTimeZone.forOffsetMillis((of * 60_000).to_i)
JODA::DateTimeZone.forOffsetMillis((of * 86_400_000).to_i)
end

chrono = if sg == ITALY
Expand Down

0 comments on commit 186665e

Please sign in to comment.