I do not think the provided calendar.js supports this, only minYear and 
maxYear. You may have to use a different calendar js. The validators handle 
it but that is not reflected in the UI.

On Tuesday, 1 December 2015 03:55:29 UTC-6, Manuele wrote:
>
> Hi! 
> I'd like to disable selection of date outside a defined preriod 
> redefining the calendar widget for my datetime form field... I've tryied 
> this way without success: 
>
> 1. defining the datetime field with a string widget: 
>   
>         Field("checkin", "datetime", label=T("Check-in date"), 
>             default = defaults["checkin"], 
>             requires = IS_DATETIME_IN_RANGE( 
>                 minimum = _mindate, 
>                 maximum = _now, 
>                 error_message = T("Invalid date")), 
>             widget = SQLFORM.widgets.string.widget 
>         ) 
>
> 2. defining the calendar object in the view using a js script at the end 
> of the page: 
>
> <script type="text/javascript"> 
>     Calendar.setup({ 
>         inputField: "no_table_checkin", 
>         showsTime: true, 
>         ifFormat: "%d/%m/%Y %H:%M:%S", 
>         timeFormat: "24", 
>         min: 20150601, 
>         max: 20160301 
>     }); 
> </script> 
>
> The new calendar widget is correctly attached to the string input but 
> min and max attributes are not considered. 
> Looking in the code of web2py.js script I noticed that, for example, the 
> attribute showsTime in the official dynarch documentation[1] is reported 
> as showTime... so I ask my self if the min and max parameters are 
> reported also correctly... 
>
> Can anybody helpme? 
> Thank you very mutch 
>
>     Manuele 
>
> [1] http://www.dynarch.com/jscal/ 
>
>

-- 
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/d/optout.

Reply via email to