This is not the proper way of handling it because the format appears
in both the validator and the javascript (for calendar).

change your code in

db.entry.date.requires=IS_DATE(format=T('%Y/%m/%d'),
                          error_message=T('use YYYY/MM/DD!'))

Then create a de.py and de-de.py language files and edit the
translation of the date format and the error message.

Massimo

On May 26, 6:51 am, Marco Tuckner <[email protected]>
wrote:
> Hello,
>
> in my model I have defined a custom (German) date format:
>
> db.entry.date.requires=IS_DATE(format=T('%d.%m.%Y'),
>                          error_message=T('use DD.MM.YYYY!'))
>
> But when users select a date in the form using the calender, it is
> inserted as:
> 2009-05-19 and thus would never pass the validation.
>
> What do I need to change?
>
> Thanks and regards,
> Marco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to