Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

DateFieldDefinition  renders a calendar that allows the user to select a a date and optionally a time.

Class: info.magnolia.ui.form.field.definition.DateFieldDefinition

Here is an example of a date field used in the stkEventIntro dialog.

Node name

Value

 date


 class

info.magnolia.ui.form.field.definition.DateFieldDefinition

 description

dialogs.pages.event.stkEventHeader.tabMain.date.description

 label

dialogs.pages.event.stkEventHeader.tabMain.date.label

 required

true

 time

true

 type

Date

You can use all common field properties and the following.

PropertyDescriptionDefault value
timeEnables time selection. Renders dropdown boxes at the bottom of the calendar.false
typeSet the type property to Date to ensure that the value is saved as a Calendar object and not a String. The addition of this property is essential.none
dateFormatDate format. See SimpleDateFormat class for allowed patterns.yyyy-MM-dd
timeFormatTime format. See SimpleDateFormat class for allowed patterns.HH:mm:ss

(warning) The jsDateFormat/jsTimeFormat properties are no longer supported in Magnolia 5.

  • No labels