Forum: Rails I18n Date validation fails for all September dates in Spanish

Posted by Dave Christiansen (Guest)
on 2010-04-02 21:56
(Received via mailing list)
Here's how I've got my dates set up:



date:
formats:
# Use the strftime parameters for formats.
# When no format has been given, it uses default.
# You can provide other formats here if you like!
default: "%d-%m-%Y"
short: "%b %d"
long: "%B %d, %Y"


day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado]
abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab]


# Don't forget the nil at the beginning; there's no such thing as a 0th 
month
month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, 
Agosto, Septiembre, Octubre, Noviembre, Diciembre]
abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, 
Nov, Dic]
# Used in date_select and datime_select.
order: [ :día, :mes, :día]


If I enter any September date, such as Septiembre 10, 1991, then I get a 
validation error like this: Se produjeron problemas con los campos 
siguientes:

    • Fecha de nacimiento is not a valid date


I know, I've got some work to do on the validation message. But the 
bigger question is... why is the validation failing? Is anyone else 
seeing this?


Thanks!

Dave Christiansen
Senior Developer
Collaborative Software Initiative
317-966-6154
dave@csinitiative.com
Posted by Henrik --- (malesca)
on 2010-04-03 09:23
(Received via mailing list)
On Fri, Apr 2, 2010 at 21:55, Dave Christiansen <dave@csinitiative.com> 
wrote:
> If I enter any September date, such as Septiembre 10, 1991, then I get a
> validation error

You enter it through a date_select, right, not by typing the string in
a text_field? Rails doesn't support the latter, to my knowledge.
Posted by Dave Christiansen (Guest)
on 2010-04-03 13:22
(Received via mailing list)
We use a jquery UI datepicker.

Here's what's really weird about this. If I type in the date in the 
mm/dd/yyyy format like this: 9/10/1991, then it works and after saving 
is displayed as Septiembre 10, 1991. If I don't change anything and try 
to save it, I get the validation error. For some reason, this only 
happens on September dates.

Dave Christiansen
Senior Developer
Collaborative Software Initiative
317-966-6154
dave@csinitiative.com

----- Original Message -----
From: "Henrik Nyh" <henrik@nyh.se>
To: rails-i18n@googlegroups.com
Sent: Saturday, April 3, 2010 3:21:27 AM
Subject: Re: [rails-i18n] Date validation fails for all September dates 
in   Spanish

On Fri, Apr 2, 2010 at 21:55, Dave Christiansen <dave@csinitiative.com> 
wrote:
> If I enter any September date, such as Septiembre 10, 1991, then I get a
> validation error

You enter it through a date_select, right, not by typing the string in
a text_field? Rails doesn't support the latter, to my knowledge.

--
You received this message because you are subscribed to the Google 
Groups "rails-i18n" group.
To post to this group, send email to rails-i18n@googlegroups.com.
To unsubscribe from this group, send email to 
rails-i18n+unsubscribe@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rails-i18n?hl=en.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.