On Monday, June 26, 2017 at 12:04:37 PM UTC-4, Richard wrote:
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#IS_DATE
>
> I don't know if we enforce that this formatting respect any python 
> standard...
>
> I can give a try if we can pass flatpickr parameters without issue... 
>

The point is, there is no reason that IS_DATE must use the same formatting 
strings as Flatpickr. For example, just do the following:

Field('mydate', 'date', requires=IS_DATE(format=T('%Y-%m-%d'))

and in web2py_ajax.html (and similarly in web2py.js):

var w2p_ajax_date_format = "{{=T('Y-m-d')}}";

w2p_ajax_date_format gets passed to Flatpickr. In that case, Flatpickr will 
generate dates that are in the format expected by IS_DATE(). But there is 
no reason that w2p_ajax_date_format must itself be a Python date formatting 
string -- it can simply using the Flatpickr formatting.

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

Reply via email to