Very strange. This works for me at Chromium Version 32.0.1700.107 Ubuntu 
12.04:

def test_date():
    T.force('it')

    db = DAL('sqlite:memory:')
    db.define_table('test', Field('d', 'date'))

    form = SQLFORM(db.test)
    form.validate()

    return dict(form=form)

At it.py (you can also translate 'enter date as %(format)s'):

'%Y-%m-%d': '%d/%m/%Y',

If i mispelled date intentionally i get:
enter date as 28/08/1963

Does this code work for you?.

By the way i've noticed you've mispelled the format in your post (one 
percent symbol is missing at %d/m/%Y). Check it at your languege file just 
in case...

Regards.


El martes, 4 de marzo de 2014 22:50:17 UTC+1, Gael Princivalle escribió:
>
> Ok so like that:
> Field('concert_date', type='date', requires = IS_DATE(format='%Y-%m-%d'))
> And on Chrome problem still the same.
> I think the problem is more global about language detection with Chrome.
>
> If I use web2py on Firefox I've got no problems.
>
> On Chrome it's a disaster. For example when I go on the welcome app, it's 
> always in English, not in Italian.
>
> Here is my routes.py :
> routers = dict(
>      BASE = dict(
>                  domains = { 
>                            'domain1.it' : 'myapp1',
>                            'domain2.it':  'myapp2',
>                            },
>                  default_application='welcome', 
>                 ),
>      myapp1 = dict(languages=['en', 'it'], default_language='it'),
>      myapp2 = dict(languages=['en', 'it'], default_language='it'),
> )
>
> Do you know what's the problem ?
>
> Regards
>
> Il giorno martedì 4 marzo 2014 22:26:37 UTC+1, Anthony ha scritto:
>>
>> Here is my field in db.py:
>>> Field('concert_date', type='date', requires = IS_DATE(format=T(
>>> '%Y-%m-%d')))
>>>
>>
>> Do not wrap the "format" argument to IS_DATE() in T() -- it will be 
>> translated automatically.
>>
>> Also, if desired, note that you can alter the date format for the 
>> Javascript widget universally here: 
>> https://github.com/web2py/web2py/blob/master/applications/welcome/views/web2py_ajax.html#L5
>> .
>>
>> Anthony
>>
>

-- 
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.

Reply via email to