Bootstrap 3 datepicker

59 views
Skip to first unread message

Gael Princivalle

unread,
Aug 21, 2016, 9:28:18 AM8/21/16
to web2py-users
Hello.

I'm trying to use Bootstrap 3 datepicker.

Edward have already use it:

I use it for datetime, the result in the input is like:
03/09/2016 14:00
The form returns me an error as it need also the seconds like:
03/09/2016 14:00:00

The seconds for this application are not important, it could be a solution appending :00 to the input.

Someone knows how I can resolve it?

Thanks.

Mirek Zvolský

unread,
Aug 23, 2016, 6:55:43 AM8/23/16
to web2py-users
In Web2py you can set this in Field(), in db model or in SQLFORM.factory, via requires=.
Something like:

requires
=[IS_NOT_EMPTY_(), IS_DATETIME(format='%d.%m.%Y %H:%M')]


And you can use T('%d.%m.%Y %H:%M') and translate format for different locales.




Dne neděle 21. srpna 2016 15:28:18 UTC+2 Gael Princivalle napsal(a):

Gael Princivalle

unread,
Aug 23, 2016, 7:32:38 AM8/23/16
to web2py-users
Thank's Mirek I'll do like that.
Reply all
Reply to author
Forward
0 new messages