Skip to content

Commit

Permalink
Add "Number" and "Date" fields
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Aug 20, 2020
1 parent 0077d09 commit e732645
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions templates/helpers/_field_blocks.twig
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@
{{ field.value.responsive_inline|raw }}
{% endif %}

{# Number fields #}
{% if type == "number" %}
<p><strong>{{ field|label }}</strong>: <code>{{ field }}</code></p>
{% endif %}

{# Date / Datetime fields #}
{% if type == "date" %}
<p>
<strong>{{ field|label }}</strong>: {{ field|localedatetime("%A %B %e, %Y") }}
{%- if field.definition.mode == 'datetime' %}, {{ field|localedatetime("%H:%M:%S") }}{% endif %}
</p>
{% endif %}

{# No special cases defined for other fieldtypes. We just output them if
they're a simple scalar, and 'dump' them otherwise. #}
{% if type not in allfields and field is not empty %}
Expand Down

0 comments on commit e732645

Please sign in to comment.