Issue #7137 has been updated by tadf (tadayoshi funaba).


also the following examples should raise error:

Mon Mon Mon
Mon OR Fri?
Good Friday
Friday Sept 11 2001
Sept 11, 2001 & 2002

the original parsedate written by matz.
once, i rewrote the library with a parser generator.
it seems fine, it is strict, but slow.
we decided to back to pattern matching solution.
so i re-rewrote parsedate that the origin of the current parse method.

if we should *fix* this, we should accept new spec and pay the cost.

see:
http://www.funaba.org/en/date2/manual.html
http://www.funaba.org/date2/parsedate.html
----------------------------------------
Bug #7137: Date.parse overly lenient when attempting to parse Monday?
https://bugs.ruby-lang.org/issues/7137#change-30538

Author: garysweaver (Gary Weaver)
Status: Rejected
Priority: Low
Assignee: tadf (tadayoshi funaba)
Category: lib
Target version: 
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


irb(main):001:0> require 'date'
=> true
irb(main):002:0> Date.parse('Monitoring')
=> #<Date: 2012-10-08 ((2456209j,0s,0n),+0s,2299161j)>
irb(main):003:0> Object.constants.sort.each{|c|puts "#{c}=#{Object.const_get(c)}" if c.to_s.start_with? 'RUBY'}; nil
RUBY_COPYRIGHT=ruby - Copyright (C) 1993-2012 Yukihiro Matsumoto
RUBY_DESCRIPTION=ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
RUBY_ENGINE=ruby
RUBY_PATCHLEVEL=194
RUBY_PLATFORM=x86_64-linux
RUBY_RELEASE_DATE=2012-04-20
RUBY_REVISION=35410
RUBY_VERSION=1.9.3
=> nil

It's nice that it tries to make sense out of strings liberally, but turning "Monitoring" into "Monday" seems a bit too lenient. Understand the workaround is not to use Date.parse, but I think this is buggy.

Thanks!


-- 
http://bugs.ruby-lang.org/