DateFieldDefinition
renders a calendar that allows the user to select a date and optionally a time.
This date field definition is part of the Magnolia 6 UI framework. The fully qualified class name is info.magnolia.ui.field.DateFieldDefinition
.
If you work with the Magnolia 5 UI framework, see Date field for Magnolia 5 UI instead.
Example date field definition
date: label: Date $type: dateField type: java.util.Date time: true
Date field properties
| optional, default is Format in which the date is displayed to users. See the Examples: dateFormat: yyyy-MM-dd # 2017-10-31 dateFormat: yyyy-MMMM-dd # 2017-October-31 dateFormat: EEE, MMM d, yyyy # Tue, Oct 31, 2017 |
| optional, default is Set to a specific date and time such as The default value applies only to new content items, not to those that have already been created. Enclose the property value in quotes when using YAML: defaultValue: "2017-10-31" defaultValue: "2017-10-31 15:09" If you define the dateFormat: MM/dd/yyyy timeFormat: h:mm a defaultValue: "10/31/2017 3:09 PM" |
| optional, default is Enables time selection. Renders dropdown lists at the bottom of the calendar. |
| optional, default is Format in which the time is displayed to users. See the Examples: timeFormat: HH:mm # 15:09 timeFormat: h:mm a # 3:09 PM |
See also Common field properties.