![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ftw.datepicker
provides a date/time picker widget for your z3c.form
fields using the jQuery based DateTimePicker
widget from XDSoft
(http://xdsoft.net/jqplugins/datetimepicker/). It is compatible with
Plone 4.3 and 5.1.
.. image:: https://github.com/4teamwork/ftw.datepicker/raw/master/docs/screenshot.png
Add ftw.datepicker to your buildout configuration:
::
[instance]
eggs +=
...
ftw.datepicker
Import the generic setup profile for ftw.datepicker
.
You can apply the widget to your field with the help of
plone.directives.form
:
.. code:: python
from plone.directives import form
from plone.supermodel import model
from ftw.datepicker.widget import DateTimePickerWidgetFactory
class MySchema(model.Schema):
form.widget(due_date=DateTimePickerWidgetFactory)
due_date = schema.Datetime()
This renders a widget which allows to select the date and time.
You can pass a custom configuration of the widget like this:
.. code:: python
from plone.directives import form
from plone.supermodel import model
from ftw.datepicker.widget import DateTimePickerWidgetFactory
class MySchema(model.Schema):
form.widget('due_date', DateTimePickerWidgetFactory, config=my_config)
due_date = schema.Datetime()
config
can either be a dict or a callable which produces a dict. The value
is then converted to a JSON object and passed to the template for the widget
to be picked up. Example: {'format': 'd.m.Y', 'timepicker': False}
.
See http://xdsoft.net/jqplugins/datetimepicker/ for a full list of options.
You could apply the widget even to a TextLine
field if you need to.
If you wish to use the Widget for a date field that needs a timezone, you can
tell it so by setting default_timezone
to an Olson DB/pytz timezone
identifier or a callback (taking the context as an argument) returning such an
identifier:
.. code:: python
from plone.directives import form
from plone.supermodel import model
from ftw.datepicker.widget import DateTimePickerWidgetFactory
class MySchema(model.Schema):
form.widget('due_date',
DateTimePickerWidgetFactory,
default_timezone='Europe/Berlin') # or in
due_date = schema.Datetime()
In case you want to use this widget for an already defined field you can do
that too. In case of IEventBasic
you must set the default_timezone
due
to how plone.appe.event
works.
.. code:: python
from plone.autoform.interfaces import WIDGETS_KEY
WIDGETS = {
MySchema: {'start_date': DatePickerFieldWidget,
'end_date': DatePickerFieldWidget},
}
for schema, widget_config in WIDGETS.items():
values = schema.queryTaggedValue(WIDGETS_KEY, {})
values.update(widget_config)
schema.setTaggedValue(WIDGETS_KEY, values)
# Or with the default_timezone and/or config set:
from plone.app.event.base import default_timezone
from plone.app.event.dx.behaviors import IEventBasic
from plone.autoform.interfaces import WIDGETS_KEY
from plone.autoform.widgets import ParameterizedWidget
WIDGETS = {
IEventBasic: {'start': ParameterizedWidget(DatePickerFieldWidget,
default_timezone=default_timezone,
config=my_config),
'end': ParameterizedWidget(DatePickerFieldWidget,
default_timezone=default_timezone,
config=my_config)},
}
for schema, widget_config in WIDGETS.items():
values = schema.queryTaggedValue(WIDGETS_KEY, {})
values.update(widget_config)
schema.setTaggedValue(WIDGETS_KEY, values)
The jQuery plugin can be downloaded and extracted into its own folder inside
ftw/datepicker/resources/js
. Only the files defined in the profile's
CSS and JS registry will be used.
This package is copyright by 4teamwork <http://www.4teamwork.ch/>
_.
ftw.datepicker
is licensed under GNU General Public License, version 2.
Add support for combined (country specific) language codes. [mathias.leimgruber]
Update DateTimePicker to version 2.5.18. [mathias.leimgruber]
Add Plone 5.1 support [njohner]
Update translations aka make them work. [mathias.leimgruber]
Do not allow a year before 1900. strftime in python 2.7 does not support years before 1900. [mathias.leimgruber]
Implement additional config options. [tschanzt]
Drop compatibility with Plone 4.1 and Plone 4.2. [mbaechtold]
Make it possible to use different dateformats depending on the current language. [tschanzt]
Use DateTimePicker widget from XDSoft which also supports time picking (http://xdsoft.net/jqplugins/datetimepicker/). Attention: Support for Plone 4.0.x has been dropped. [mbaechtold]
Added some French translations [ttschanz]
Fix date parsing for french language (support lowercase month names). [jone]
Issue #1176 alle translatinos mit from zope.i18n import translate https://extranet.4teamwork.ch/projects/opengever-kanton-zug/sprint-backlog/1176 [eschmutz]
added test-buildout for plone 4.1 [eschmutz]
FAQs
A z3c.form datepicker widget (Maintainer Thomas Buchberger)
We found that ftw.datepicker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.