aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-10 10:59:17 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-10 10:59:17 +0000
commitf635d1b041015478f3bc790ebec469a68cde5a5a (patch)
tree8325b71584c102ba2ff2c5a4eb741ccd3cfa1405 /lib
parentd4c63f862b574863011a110e4502162b0ab9fa0a (diff)
downloadruby-f635d1b041015478f3bc790ebec469a68cde5a5a.tar.gz
[ruby-core:31658]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/date.rb10
-rw-r--r--lib/date/format.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 5295ce9b7f..3bb0875023 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, _, d = jd_to_civil(jd, sg)
+ y, m, 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, = jd_to_civil(jd, sg)
+ y, m, d = 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, =
+ ny, nw, nd =
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, =
+ ny, nw, nd, nf =
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, =
+ ny, nm, nn, nk =
jd_to_nth_kday(nth_kday_to_jd(ny, nm, 1, k, sg) + n * 7, sg)
return unless [ny, nm] == [y, m]
n = nn
diff --git a/lib/date/format.rb b/lib/date/format.rb
index b30cf3a41e..5aacb2a128 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -356,7 +356,7 @@ class Date
def jisx0301
if jd < 2405160
- iso8601
+ strftime('%F')
else
case jd
when 2405160...2419614