Attention

This document was written for an unsupported version of Plone, Plone 2.1.x, and was last updated 1606 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Display Date only in Calendar Widget

How do I configure CalendarWidget to get the date information without displaying time?

« Back to Table of Contents

Warning: This item is marked as outdated.

The calendar widget has an option called "show_hm" which should allow you  to choose whether you want hours/minutes or not.

According to some people on a different list, the argument 'show_hm'  should be working in the edit forms as long as you are using Plone 2.1.  For display, you'll have to use strftime().


Example:

      DateTimeField('startDate',
required=True,
searchable=True,
accessor='start',
default_method=DateTime,
languageIndependent=True,
widget = CalendarWidget(
description=("Enter the starting date and time, or click "
"the calendar icon and select it. "),
description_msgid = "help_event_start",
label="Event Starts",
show_hm = False,
label_msgid = "label_event_start",
i18n_domain = "plone")),