summaryrefslogtreecommitdiff
path: root/lib/parsedate.rb
diff options
context:
space:
mode:
author(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-01 07:48:23 +0000
committer(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-01 07:48:23 +0000
commit83c93751fe1c5a5bcb6d8bf88d6900eaae8173dc (patch)
treeb79d198709497f123f1a79a3a52bebac603d7753 /lib/parsedate.rb
parent62e648e148b3cb9f96dcce808c55c02b7ccb4486 (diff)
This commit was manufactured by cvs2svn to create tag
'v1_3_1_990201'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_3_1_990201@387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/parsedate.rb')
-rw-r--r--lib/parsedate.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/parsedate.rb b/lib/parsedate.rb
index 68550c6505..5ffd2da47c 100644
--- a/lib/parsedate.rb
+++ b/lib/parsedate.rb
@@ -8,7 +8,7 @@ module ParseDate
'sun' => 0, 'mon' => 1, 'tue' => 2, 'wed' => 3,
'thu' => 4, 'fri' => 5, 'sat' => 6 }
DAYPAT = DAYS.keys.join('|')
-
+
def parsedate(date)
# part of ISO 8601
# yyyy-mm-dd | yyyy-mm | yyyy
@@ -58,6 +58,10 @@ module ParseDate
if $3
year = $3.to_i
end
+ elsif date.sub!(/(\d+)-(#{MONTHPAT})-(\d+)/i, ' ')
+ mday = $1.to_i
+ mon = MONTHS[$2.downcase]
+ year = $3.to_i
end
return year, mon, mday, hour, min, sec, zone, wday
end