# Date validation fails for all September dates in Spanish

**URL:** <https://www.ruby-forum.com/t/date-validation-fails-for-all-september-dates-in-spanish/186241>\
**Category:** Rails I18n\
**Created:** [April 2, 2010, 9:56pm UTC](https://www.ruby-forum.com/t/date-validation-fails-for-all-september-dates-in-spanish/186241 "2010-04-02T21:56:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [April 2, 2010, 9:56pm UTC](https://www.ruby-forum.com/t/date-validation-fails-for-all-september-dates-in-spanish/186241/1 "2010-04-02T21:56:43Z")

</div>

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 C.  
Senior Developer  
Collaborative Software Initiative  
317-966-6154  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [April 3, 2010, 9:23am UTC](https://www.ruby-forum.com/t/date-validation-fails-for-all-september-dates-in-spanish/186241/2 "2010-04-03T09:23:15Z")

</div>

On Fri, Apr 2, 2010 at 21:55, Dave C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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.

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [April 3, 2010, 1:22pm UTC](https://www.ruby-forum.com/t/date-validation-fails-for-all-september-dates-in-spanish/186241/3 "2010-04-03T13:22:03Z")

</div>

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 C.  
Senior Developer  
Collaborative Software Initiative  
317-966-6154  
removed\_email\_address@domain.invalid

----- Original Message -----  
From: “Henrik N.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
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 C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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 removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rails-i18n?hl=en](http://groups.google.com/group/rails-i18n?hl=en).
