diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-17 06:18:53 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-17 06:18:53 +0000 |
commit | e44f5bcbd90d51a1d638e19ec08726b1f9b10664 (patch) | |
tree | e1995b705493805063ac685d3fda047ae88c8edf | |
parent | 05745ccfb367ab670ebbad8c992edf2cf70d8b4b (diff) | |
download | ruby-e44f5bcbd90d51a1d638e19ec08726b1f9b10664.tar.gz |
* lib/date.rb: Re-revert the part of r28950.
It reverted the part of r28619.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/date.rb | 10 |
2 files changed, 11 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Tue Aug 17 15:13:28 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/date.rb: Re-revert the part of r28950. + It reverted the part of r28619. + Tue Aug 17 13:00:07 2010 Tanaka Akira <akr@fsij.org> * ext/pathname/pathname.c (path_dirname): Pathname#dirname translated @@ -243,7 +248,7 @@ Tue Aug 10 15:24:30 2010 Kenta Murata <mrkn@mrkn.jp> ext/bigdecimal/extconf.rb: BASE and BASE_FIG are defined based on the size of BDIGIT. - * ext/bigdecimal/bigdecimal.c, ext/bigdecimal/bigdecimal.h: + * ext/bigdecimal/bigdecimal.c, ext/bigdecimal/bigdecimal.h: use BDIGIT for Real#frac. Tue Aug 10 15:19:45 2010 Kenta Murata <mrkn@mrkn.jp> diff --git a/lib/date.rb b/lib/date.rb index 3bb0875023..5295ce9b7f 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -470,7 +470,7 @@ class Date end def jd_to_weeknum(jd, f=0, sg=GREGORIAN) # :nodoc: - y, m, d = jd_to_civil(jd, sg) + y, _, d = jd_to_civil(jd, sg) a = find_fdoy(y, sg) + 6 w, d = (jd - (a - ((a - f) + 1) % 7) + 7).divmod(7) return y, w, d @@ -486,7 +486,7 @@ class Date end def jd_to_nth_kday(jd, sg=GREGORIAN) # :nodoc: - y, m, d = jd_to_civil(jd, sg) + y, m, = jd_to_civil(jd, sg) j = find_fdom(y, m, sg) return y, m, ((jd - j) / 7).floor + 1, jd_to_wday(jd) end @@ -645,7 +645,7 @@ class Date d += 8 end if w < 0 - ny, nw, nd = + ny, nw, = jd_to_commercial(commercial_to_jd(y + 1, 1, 1, sg) + w * 7, sg) return unless ny == y w = nw @@ -660,7 +660,7 @@ class Date d += 7 end if w < 0 - ny, nw, nd, nf = + ny, nw, = jd_to_weeknum(weeknum_to_jd(y + 1, 1, f, f, sg) + w * 7, f, sg) return unless ny == y w = nw @@ -677,7 +677,7 @@ class Date if n < 0 ny, nm = (y * 12 + m).divmod(12) nm, = (nm + 1) .divmod(1) - ny, nm, nn, nk = + ny, nm, nn, = jd_to_nth_kday(nth_kday_to_jd(ny, nm, 1, k, sg) + n * 7, sg) return unless [ny, nm] == [y, m] n = nn |