The thing is, IS_DATE/TIME gets the default format that is %Y-%m-%d, that is looked up in translations before being passed to the validator itself . This is to enable true internationalization for date/time formats and it works pretty well. If you want everybody to see your fixed format, remove the corresponding translation from the languages/* py files or alter it accordingly.
Summary: if you have the languages folder, you just have to act on the default %Y-%m-%d string translation. If you don't have it and you force your language to be fixed, you can act on that one. BTW, a simple requires=IS_DATE(format='%d-%m%-%Y') works, given that no '%d-%m-%Y' is never translated. Il giorno venerdì 20 settembre 2013 12:03:06 UTC+2, Joe Barnhart ha scritto: > > I'm trying to change the date format from YYYY/MM/DD to MM-DD-YYYY in my > application. I've tried everything yet I can't seem to get my SQLFORM to > respond to the date format I want. > > All I want is to change the DISPLAY and INPUT behavior of the date field > to match the pattern MM-DD-YYYY. I thought setting a validator alone would > do that, but it only changes the input format specification (apparently). > Setting a "represent" does nothing unless the value is read-only (from > reading the code), but my field is read/write. > > Am I making this more complicated than it should be? I am not using any > of the translation services, all I want is simple, US English only, no > translations, plain date format both input and output, set to mm-dd-yyyy. > > I'm stumped. > > -- Joe > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

