views:

9

answers:

0

I used validates_timeliness for validating the date in my application. It functions well for English locale. I added this line to initializers:

ValidatesTimeliness::Formats.add_formats(:date, "mmm dd, yy")

and Rails can then validate date in this format July 04, 2010.

But when I change the locale to some other locale, e.g. Chinese zh-TW. the date July 04, 2010 can't pass the validation.

Does anyone have any idea on this? How can I get the date pass the validation in other locale?

Thanks all. :)