Last modified: Dec 2, 2024

Date

A component that allows you to display a formatted date with or without label.

Usage

The Date component allows users to add structured formatted date, with or without label.

Anatomy

  1. Horizontal: A date with a label structured horizontally
    Date horizontal anatomy
    Date Horizontal
  2. Vertical: A date with a label structured vertically
    Date vertical anatomy
    Date vertical

Properties

We are currently updating how we implement components, and the list of properties may not be entirely accurate.
PropertyTypeDescription
idstringThe component ID. Must be unique within all layouts/pages in a layout-set. Cannot end with .
valuestringA hardcoded string or expression for resolving the date you want to display. Must resolve to a ISO6801 string.
textResourceBindings.titlestringA label for the date you want to display.
formatstringA formatting string based on Unicode Technical standard.
directionstringSets the structured direction of label and value.

Enum: [horizontal, vertical] .

Default: horizontal.

Configuration

Add component

{
  "id": "date",
  "type": "Date",
  "textResourceBindings": {
    "title": "Date"
  },
  "value": "2022-09-27 18:00:00.000",
  "format": "dd.MM.yyyy",
  "direction": "horizontal",
},

Add title and elements


textResourceBindings.title

Label for the date. This can be added as a hardcoded string or as a reference to a text resource.

value

The value of the date to be displayed. Can be added as a string or an expression.

format

Sets the formatting of the date provided in the value field. This is based on Unicode Technical standard.

direction

Decides if the date should be shown under or next to the label. horizontal for showing it next to the label and vertical for under.


Example

Date with label.

...
{
  "id": "date",
  "type": "Date",
  "textResourceBindings": {
    "title": "Date"
  },
  "value": "2022-09-27 18:00:00.000",
  "format": "dd.MM.yyyy",
  "direction": "horizontal",
},