summaryrefslogtreecommitdiff
path: root/lib/date/format.rb
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-06 11:41:12 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-06 11:41:12 +0000
commit50ef71fa1e6a003da57d764858a134d220242f44 (patch)
tree0f43402a6c545793cc2437e97380486d9eac41e7 /lib/date/format.rb
parent6839b72dc54dad0b48a2e98f70996b7f3342be8a (diff)
%[EO]U didn't denote %U.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date/format.rb')
-rw-r--r--lib/date/format.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb
index 04fadd84a2..4425635d33 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -148,7 +148,7 @@ class Date
return unless str.sub!(/\A(\d+)/o, '')
val = $1.to_i
return unless (0..53) === val
- elem[if c == '%U' then :wnum0 else :wnum1 end] = val
+ elem[if c[-1,1] == 'U' then :wnum0 else :wnum1 end] = val
when '%u'
return unless str.sub!(/\A(\d+)/o, '')
val = $1.to_i
@@ -533,7 +533,7 @@ class Date
when '%t'; o << "\t" # P2,ID
when '%U', '%W'
a = self.class.civil_to_jd(year, 1, 1, ns?) + 6
- k = if c == '%U' then 0 else 1 end
+ k = if c[-1,1] == 'U' then 0 else 1 end
w = (jd - (a - ((a - k) + 1) % 7) + 7) / 7
o << '%02d' % w
when '%u'; o << '%d' % cwday # P2,ID