Skip to content

time

time fields are text field with UI support, and limitation, for saving time values. Times are stored in 24 hour HH:MM:SS format.

Module field definition

javascript
// Configuring the `eventTime` field in a module's `fields.add` subsection:
eventTime: {
  label: 'What time is the event?',
  type: 'time'
}

Settings

Required

PropertyTypeDefaultDescription
labelStringn/aSets the visible label for the field in the UI
typeStringn/aSpecifies the field type (string for this type)

Optional

PropertyTypeDefaultDescription
defStringn/aThe default value for the field. Must be in HH:MM:SS format.
helpStringn/aHelp text for the content editor
htmlHelpStringn/aHelp text with support for HTML markup
ifObject{}Conditions to meet before the field is active. See the guide for details.
requiredIfObject{}Conditions to meet before the field is required. See the guide for details.
hiddenBooleanfalseIf true, the field is hidden
requiredBooleanfalseIf true, the field is mandatory
readOnlyBooleanfalseIf true, prevents the user from editing the field value

NOTE

If you do not set def: null or required: true, the time defaults to the current time.

Use in templates

Times are stored, and will print, in the HH:MM:SS format.

nunjucks
{{ data.piece.eventTime }}