Issue #13036 has been updated by Gonzalo Reutter.


Even if Ruby have never intended to parse dates other than English it works quite well parsing Spanish dates. I'm quite confident that it uses [dates_international.rb](https://gist.github.com/jackrg/2927162) for the magic. I base my belief in the fact that Ruby and that code reproduce the exact same bug, buy defulting to the current month. The the problem is solved by changing line 37 from:

37: month_from = string[/[^\s\d,]+/i]

To: 

37: month_from = string[/[a-z]+/i]

I extended the Date class locally to get pass the difficulty. Would like to contribute to the non English speaking Ruby community. Confirming that the suggested solution work for other languages as well and then merging to the main branch.

I would need to know exactly how the library is connected to Ruby in order to try. Help needed.


----------------------------------------
Bug #13036: Date.parse mishandling spanish months "Abril y Agosto"
https://bugs.ruby-lang.org/issues/13036#change-62342

* Author: Gonzalo Reutter
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.3.0
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
### Steps to reproduce
$ irb

2.3.0 :003 > Date.parse("01-Agosto-2016")
 => 01 Dec 2016  
2.3.0 :004 > Date.parse("01-Abril-2016")
 => 01 Dec 2016 

### Expected behavior
2.3.0 :003 > Date.parse("01-Agosto-2016")
 => 01 Aug 2016  
2.3.0 :004 > Date.parse("01-Abril-2016")
 => 01 Apr 2016 

### Actual behavior
"Agosto" is parsed to December
"Abril" is parsed to December.

### System configuration
Ruby 2.3.0

Would much like to fix this myself, should be straight forward, but I'm a hobby developer and have never contributed to a project.




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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>