summaryrefslogtreecommitdiff
path: root/lib/parsedate.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-19 19:00:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-19 19:00:28 +0000
commit77b8745d4a80e819fe523b4a4d0dbff3e779446a (patch)
treecb8733b904060e8d0b8cca7296baa113e36e7377 /lib/parsedate.rb
parent72d9a8598df5b3744743d0b7615701e1923e300c (diff)
* parse.y (yylex): fixed serious syntax misbehavior. do's
preceding was too high. a block in `foo bar do .. end' should be passed to `foo', not `bar'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/parsedate.rb')
-rw-r--r--lib/parsedate.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/parsedate.rb b/lib/parsedate.rb
index eee114a..7fc75cf 100644
--- a/lib/parsedate.rb
+++ b/lib/parsedate.rb
@@ -1,5 +1,5 @@
-# parsedate.rb: Written by Tadayoshi Funaba 2000
-# $Id: parsedate.rb,v 1.2 2000-04-01 12:16:56+09 tadf Exp $
+# parsedate3.rb: Written by Tadayoshi Funaba 2000, 2001
+# $Id: parsedate3.rb,v 1.3 2001-01-18 12:09:47+09 tadf Exp $
module ParseDate
@@ -46,7 +46,12 @@ module ParseDate
hour = $1.to_i
min = $2.to_i
sec = $3.to_i if $3
- hour += 12 if $4 and $4.downcase == 'p'
+ if $4
+ hour %= 12
+ if $4.downcase == 'p'
+ hour += 12
+ end
+ end
zone = $5
end