summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-16 06:05:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-16 06:05:46 +0000
commitb0edb6968fecaa368d2980f0572e6c7cd203e734 (patch)
treefffb60aa130f9c80a26bbe2141485a5ae4540225 /lib
parentd18d1cea2ec069a98b803533d4f43b7252276ce5 (diff)
pass_block, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@74 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/parsedate.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/parsedate.rb b/lib/parsedate.rb
index 69b7ae98a9..861e036264 100644
--- a/lib/parsedate.rb
+++ b/lib/parsedate.rb
@@ -11,7 +11,7 @@ module ParseDate
def parsedate(date)
# ISO 8601?
- if date =~ /(\d\d\d\d)-?(?:(\d\d)-?(\d\d)?)? *(?:(\d\d):(\d\d)(?::(\d\d))?)?/
+ if date =~ /^(\d\d\d\d)-?(?:(\d\d)-?(\d\d)?)? *(?:(\d\d):(\d\d)(?::(\d\d))?)?$/
return $1.to_i,
if $2 then $2.to_i else 1 end,
if $3 then $3.to_i else 1 end,
@@ -25,7 +25,7 @@ module ParseDate
if date.sub!(/(#{DAYPAT})[a-z]*,?/i, ' ')
wday = DAYS[$1.downcase]
end
- if date.sub!(/(\d+):(\d+)(?::(\d+))?\s*(am|pm)?\s*(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4})|[-+]\d{4}))?/i, ' ')
+ if date.sub!(/(\d+):(\d+)(?::(\d+))?\s*(am|pm)?\s*(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4})?|[-+]\d{4}))?/i, ' ')
hour = $1.to_i
min = $2.to_i
if $3