Formulator Field - DateTimeField

Widget properties

Title (title)

The title of this field. This is the title of the field that will appear in the form when it is displayed. Required.

Description (description)

Description of this field. The description property can be used to add a short description of what a field does; such as this one.

Default (default)

The default datetime.

CSS class (css_class)

The CSS class of the field. This can be used to style your formulator fields using cascading style sheets. Not required.

Alternate name (alternate_name)

An alternative name for this field. This name will show up in the result dictionary when doing validation, and in the REQUEST if validation goes to request. This can be used to support names that cannot be used as Zope ids.

Hidden (hidden)

This field will be on the form, but as a hidden field. The contents of the hidden field will be the default value. Hidden fields are not visible but will be validated.

Default to now (default_now)

Default date and time will be the date and time at showing of the form (if the default is left empty).

Date separator (date_separator)

Separator to appear between year, month, day.

Time separator (time_separator)

Separator to appear between hour and minutes.

Input style (input_style)

The type of input used. 'text' will show the date part as text, while 'list' will use dropdown lists instead.

Input order (input_order)

The order in which date input should take place. Either year/month/day, day/month/year or month/day/year.

Display date only (date_only)

Display the date only, not the time.

AM/PM time style (ampm_time_style)

Display time in am/pm format.

Validator properties

Enabled (enabled)

If a field is not enabled, it will considered to be not in the form during rendering or validation. Be careful when you change this state dynamically (in the TALES tab): a user could submit a field that since got disabled, or get a validation error as a field suddenly got enabled that wasn't there when the form was drawn.

External Validator (external_validator)

When a method name is supplied, this method will be called each time this field is being validated. All other validation code is called first, however. The value (result of previous validation) and the REQUEST object will be passed as arguments to this method. Your method should return true if the validation succeeded. Anything else will cause 'external_validator_failed' to be raised.

Required (required)

Checked if the field is required; the user has to enter something in the field.

Start datetime (start_datetime)

The date and time entered must be later than or equal to this date/time. If left empty, no check is performed.

End datetime (end_datetime)

The date and time entered must be earlier than this date/time. If left empty, no check is performed.

Allow empty time (allow_empty_time)

Allow time to be left empty. Time will default to midnight on that date.

More help

Field edit screen help