That didn't work, but looking at the code of appadmin and 
gluon/validators.py I found a possible solution:

form.vars.from = IS_DATETIME().formatter(request.now)

this is working OK.

Thanks Massimo!

Am Mittwoch, 15. April 2015 10:44:00 UTC-3 schrieb Massimo Di Pierro:
>
> One solution is:
>
> form.vars.from = IS_DATETIME()(request.now)[0]
>
> On Tuesday, 14 April 2015 17:39:01 UTC-5, Sebastián Tromer wrote:
>>
>> Hello everyone!
>>
>> I'm prepopulating a form made with the FORM helper.
>> In the form I have 2 INPUTs of type DATETIME:
>>
>> INPUT(_name='from', _class='datetime', requires = IS_DATETIME())
>>
>> I'm prepolutaing this field with:
>>
>> form.vars.from = request.now
>>
>> and I'm getting something like this:* 2015-04-14 19:31:36.242654*
>>
>> this works OK if the locale is '*en*' but when I have my browser with 
>> locale '*es*'
>> the input should be prepopulated with the format *'%d/%m/%Y 
>> %H:%M:%S.mmmmmm' *
>> because web2py (somehow) knows that it must validate using '*es*' locale.
>>
>> So, the question is: How can I prepopulate a datetime input field that 
>> pass validation in any locale?
>>
>> Thanks!
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to