Thx for help Richard, but the problem persist

It should be a bug or there is a trick?


2013/11/4 Diogo Munaro <[email protected]>

> No, the problem is that the form get accepted only if the browser language
> is english.
>
> Otherwise, if the browser is in portuguese it's change the validation to
> DD-MM-YYYY, but I don't want
>
> I don't want T or internalizations
>
>
>
> 2013/11/4 Richard Vézina <[email protected]>
>
>> Are you talking about the error message?
>>
>> This should work :
>>
>> IS_DATE(format=T('%Y-%m-%d'), error_message=T('Valid date of format :
>> YYYY-MM-DD'))
>>
>> Notice the T() above...
>>
>> Richard
>>
>>
>> On Mon, Nov 4, 2013 at 10:19 AM, Diogo Munaro <[email protected]>wrote:
>>
>>> Hi, I'm using web2py 2.7.2 and date fields on DAL are translating your
>>> validate.
>>>
>>> Example:
>>>
>>> I have in model:
>>>
>>> product = db.define_table('product',
>>> Field('expiration','date'))
>>>
>>> db.product.expiration.requires = IS_DATE(format('%Y-%m-%d'))
>>>
>>> T.force(None)
>>>
>>> When I insert a date like this:
>>> *2013-11-19*
>>>
>>>    - If my browser is in english language:
>>>
>>> It's ok and insert in database
>>>
>>>    - If my browser is in brazilian portuguese language:
>>>
>>> The form returns a error like this: *enter date as 28-08-1963*
>>>
>>> How could I force the format AAAA-MM-DD?
>>>
>>>  --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>

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