Monday, February 16, 2009

jqueryui datepicker as z3cform widget for plone

last time i released collective.z3cform.datepicker i also stripped js code out of jqueryui. this time i packed jqeuryui code and made it availiable to plone as separate package (collective.jqueryui).

you can find source code on github: http://github.com/garbas/collective.z3cform.datepicker

miohtama generously helped me with developing and actually pushed me to work on it. current state of code is rc, so expect some minor problems, but soon also stable release will be made.

not all options from datepicker are used and there is a lot of room for improvement. for now there are only 2 kinds of widgets: date and datetime widget. simple example would look like:

from collective.z3cform.datepicker.widget import DatePickerFieldWidget
from collective.z3cform.datepicker.widget import DateTimePickerFieldWidget

class ExampleForm(Form):
""" form """
fields = field.Fields(IExampleSchema)
fields['datetime_field'].widgetFactory[interfaces.INPUT_MODE] = \
DateTimePickerFieldWidget
fields['date_field'].widgetFactory[interfaces.INPUT_MODE] = \
DatePickerFieldWidget


code was also pushed to plone.org/products (using collective.dist.. tnx tarek for this usefull tool). but i found plone.org/products a little annoying since i need to wait for confirmation before my package is seen to public. is this the purpose how plone.org/product works or i screw something up.

1 comment:

Jon Stahl said...

Rok-

Thanks, this sounds like a great contribution!

Yes, new products on plone.org must be approved before they go live. This prevents spamming and helps us ensure that only Plone-related products are published.