src/components/elements/datetime
// src/components/elements/datetime/schema.yaml
$schema: http://json-schema.org/draft-07/schema#
$id: /elements/datetime
additionalProperties: false
required:
- content
properties:
content:
type: string
format: html
description:
type: string
description_attributes:
type: object
errors:
type: string
title:
type: string
title_attributes:
type: object
// src/components/elements/datetime/mocks.yaml
content:
$tpl: elements/datetime/form
$ref: elements/datetime/form
title: Title
description: Sunt occaecat est deserunt anim.
$variants:
- $name: With error
errors: <p>This is an error message.</p>
// src/components/elements/datetime/datetime.twig
{% set children %}
<div{{ attributes }} class="DateTime">
{{ content }}
</div>
{% endset %}
{% include "@elements/form/fieldset/fieldset.twig" with {
title: title,
title_attributes: title_attributes,
children: children,
errors: errors,
description: description,
description_attributes: description_attributes,
} only %}
With error mock data
content:
$tpl: elements/datetime/form
$ref: elements/datetime/form
title: Title
description: Sunt occaecat est deserunt anim.
errors: <p>This is an error message.</p>