I want to change some parameters of the Calendar

*(1) I wanted to have German texts*

*Solution:*

   - Download Calendar from http://sourceforge.net/projects/jscalendar/
   - Change web2py_ajax.html:
   response.files.insert(3,URL('static','js/calendar-de.js'))


*(2) Setup*

Now the first day of the week should be Monday and the seconds should be
suppressed. I have create a new file "calendar-setup.js" with

Calendar.setup({
    firstDay: 1,
    ifFormat: "%m.%d.%Y %H:%M",
    daFormat: "%m.%d.%Y %H:%M"
});


and changed web2py_ajax.html again:

response.files.insert(4,URL('static','js/calendar-setup.js'))


setup needs an additional fieled  "inputField":

Calendar.setup({
    inputField: *ID_OF_THE_INPUT_FIELD,*
    firstDay: 1,
    ifFormat: "%m.%d.%Y %H:%M",
    daFormat: "%m.%d.%Y %H:%M"
});


*But what id would match every INPUT?*

*(3) Two dates:*
I have two INPUT fileld for datetime: both dates must be  in the future and
the second must be before the first.

My solution (simplified):

format="%d.%m.%Y %H:%M:%S"
INPUT(_type="text", _name="a",_class="datetime",
            requires=IS_DATETIME_IN_RANGE(minimum=request.now,
                format=format)))

INPUT(_type="text", _name="b",_class="datetime",
            requires=IS_DATETIME_IN_RANGE(minimum=request.now,
                maximum=datetime.datetime.strptime(request.vars.a or
"31.12.2199 23:59:59",format),
                format=format))),

*A little bit complicated - is there any better solution?*

Regards, Martin

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