Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

dateFormat

optional, default is yyyy-MM-dd

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

Examples:

Code Block
languageyml
dateFormat: yyyy-MM-dd           # 2017-10-31
dateFormat: yyyy-MMMM-dd         # 2017-October-31
dateFormat: EEE, MMM d, yyyy     # Tue, Oct 31, 2017

defaultValue

optional, default is now

Set the property to a specific date such as "2017-10-31" or use the string now for the current date and 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 content items that have been already created.

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

Code Block
languageyml
defaultValue: "2017-10-31"
defaultValue: "2017-10-31 15:09"

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

Code Block
languagejs
dateFormat: MM/dd/yyyy
timeFormat: h:mm a
defaultValue: "10/31/2017 3:09 PM"

time

optional, default is false

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

timeFormat

optional, default is HH:mm

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

Examples:

Code Block
languageyml
timeFormat: HH:mm     # 15:09
timeFormat: h:mm a    # 3:09 PM

...