Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date.parse mishandling spanish months #27361

Closed
greutter opened this issue Dec 14, 2016 · 3 comments
Closed

Date.parse mishandling spanish months #27361

greutter opened this issue Dec 14, 2016 · 3 comments

Comments

@greutter
Copy link

greutter commented Dec 14, 2016

Steps to reproduce

$ rails console:

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

Expected behavior

2.3.0 :003 > Date.parse("01-Agosto-2016")
=> Mon, 01 Aug 2016
2.3.0 :004 > Date.parse("01-Abril-2016")
=> Xxx, 01 Apr 2016

Actual behavior

"Agosto" is parsed to December
"Abril" is parsed to December.

System configuration

Rails 5.0.0.1
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.

@nateberkopec
Copy link
Contributor

Date.parse is a Ruby method, not provided by Rails. As far as I can tell ActiveSupport doesn't affect it in any way. You'll have to take it up with Ruby.

As an aside, it does seem like Date.parse used to work with Spanish, but now it doesn't. Not sure when that changed.

@maclover7
Copy link
Contributor

👍 to @nateberkopec, Date#parse is a method provided by Ruby, not Rails. If you want to file an issue with the Ruby team, you can do so at https://bugs.ruby-lang.org/. Thank you for opening up this issue!

@greutter
Copy link
Author

Great response time! Thanks. I'll take the issue to the correct place. Hope to make my first little contribution to open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants