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

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

Date field properties

Simple date field

    - name: tabText
      label: Text
        - name: date
          class: info.magnolia.ui.form.field.definition.DateFieldDefinition
          time: false
          type: Date
          label: Date
          defaultValue: now

Node name

















You can use common field properties and the following properties in a date field definition:


<field name>


optional, default is false

Enables time selection. Renders dropdown boxes at the bottom of the calendar.



Set 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.


optional, default is yyyy-MM-dd

Format in which the date is displayed to users. See SimpleDateFormat class for allowed patterns.


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 HH:mm

Format in which time is displayed to users. See SimpleDateFormat class for allowed patterns.


timeFormat: HH:mm     # 15:09
timeFormat: h:mm a    # 3:09 PM


optional, default is now

Set the default value to a specific date such as "2017-10-31" or use the keyword now which defaults to the current date and time. Current time means time at the host server. Magnolia stores dates and times using server time. The stored time is converted and displayed to users in their preferred time zone.

The default value only applies to new content items, not to existing content items that have been created previously.

(warning) Enclose the default value in quotes when using YAML:

defaultValue: "2017-10-31"
defaultValue: "2017-10-31 15:09"

If you define the dateFormat or timeFormat properties then provide the defaultValue using those same formats:

dateFormat: MM/dd/yyyy
timeFormat: h:mm a
defaultValue: "10/31/2017 3:09 PM"
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels


  1. Hello,

    I got the following error by editing / creating a new item in an app. I have a date field in the form.

    magnolia.ui.form.field.factory.FieldFactoryFactory: No factory class set for definition class [info.magnolia.ui.form.field.definition.DateFieldDefinition$$EnhancerByCGLIB$$90296b1].
    Please check your configuration.

    Magnolia 5.6.6

    magnolia-ui-form 5.6.5

    magnolia-ui-dialog 5.6.5

    Attached: the form configuration exported as yaml.

    jcr:mixinTypes: ['mix:lockable']
    jcr:mixinTypes: ['mix:lockable']
    jcr:mixinTypes: ['mix:lockable']
    jcr:mixinTypes: ['mix:lockable']
    'class': 'info.magnolia.ui.form.field.definition.TextFieldDefinition'
    'i18n': 'true'
    'required': 'true'
    jcr:mixinTypes: ['mix:lockable']
    'class': 'info.magnolia.ui.form.field.definition.TextFieldDefinition'
    'i18n': 'true'
    'required': 'true'
    'rows': '4'
    jcr:mixinTypes: ['mix:lockable']
    'class': 'info.magnolia.ui.form.field.definition.CheckboxFieldDefinition'
    'type': 'Boolean'
    jcr:mixinTypes: ['mix:lockable']
    'appName': 'assets'
    'class': 'info.magnolia.ui.form.field.definition.LinkFieldDefinition'
    'targetWorkspace': 'dam'
    'class': ''
    'contentPreviewClass': ''
    'description': 'articles.detail.editor.articleTypes.description'
    'extends': '/modules/categorization/dialogs/generic/tabCategorization/fields/categories'
    'i18nBasename': 'info.magnolia.module.articles.messages'
    'label': 'articles.detail.editor.articleTypes.label'
    'required': 'true'
    'targetTreeRootPath': '/article-types'
    'class': 'info.magnolia.ui.form.field.definition.TextFieldDefinition'
    jcr:mixinTypes: ['mix:lockable']
    'class': 'info.magnolia.ui.form.field.definition.DateFieldDefinition'
    'defaultValue': 'now'
    'required': 'true'
    'time': 'false'
    'type': 'Date'
    'class': 'info.magnolia.ui.form.field.definition.TextFieldDefinition'
    'defaultValue': 'Article Author'
    jcr:mixinTypes: ['mix:lockable']
    'alignment': 'true'
    'class': 'info.magnolia.ui.form.field.definition.RichTextFieldDefinition'
    'configJsFile': '/.resources/qomet-website/ckeditor/config.js'
    'i18n': 'true'
    'images': 'true'
    'required': 'true'
    'rows': '50'
    'source': 'true'
    'tables': 'true'
    jcr:mixinTypes: ['mix:lockable']
    'class': 'info.magnolia.ui.form.field.definition.TextFieldDefinition'
    'i18n': 'true'
    'required': 'false'
    'rows': '2'

    1. Hello Daniel

      It is hard to read the YAML if it is not formatted. Can you post the complete app definition e.g. to or a similar service which can properly render the correct format  and then providing the link to that file?


  2. I solved the problem by updating to Magnolia 5.7

    The yaml exported configuration: 

    Thank you

    1. I have wrapped your link to github into a Expand macro to save some space (wink)