Skip to content
Twig Field Finder
Theme

Smart Date — duration / all day

Fill in your field name

Italic values are placeholders: replace them with your own machine names, or let the builder do it.

Reads the entity directly, before field formatters run.

  1. Snippet 1
    {{ node.field_name.duration }}
  2. Snippet 2
    {% if node.field_name.duration % 1440 == 1439 %}
      {# all-day event #}
    {% endif %}

Gotcha

Needs the Smart Date module. duration is in minutes. All-day events are stored as 00:00 to 23:59, so their duration is 1439 (plus 1440 for each extra day).