You are here

date-recur-basic-formatter.html.twig in Recurring Dates Field 3.x

Default theme implementation to display a recurring dates field.

Available variables:

  • date: shows first start, and end date if available, whether or not the field is a rule.
  • interpretation: The human readable repeat rule.
  • occurrences: The occurrences, if value is recurring. Individual occurrences can be printed as a whole, or properties of each occurrences can be accessed:

    • occurrence: print all properties

      • start_date: the start date.
      • end_date: the end date.
      • separator: the date separator.
  • is_recurring: Whether the field value is recurring.

File

templates/date-recur-basic-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a recurring dates field.
  5. *
  6. * Available variables:
  7. * - date: shows first start, and end date if available, whether or not the
  8. * field is a rule.
  9. * - interpretation: The human readable repeat rule.
  10. * - occurrences: The occurrences, if value is recurring. Individual occurrences
  11. * can be printed as a whole, or properties of each occurrences can be
  12. * accessed:
  13. * - occurrence: print all properties
  14. * - start_date: the start date.
  15. * - end_date: the end date.
  16. * - separator: the date separator.
  17. * - is_recurring: Whether the field value is recurring.
  18. *
  19. * @ingroup themeable
  20. */
  21. #}
  22. {% if date and not is_recurring %}
  23. <div class="date-recur-date">{{ date }}</div>
  24. {% endif %}
  25. {% if interpretation -%}
  26. <div class="date-recur-interpretaton">{{ interpretation }}</div>
  27. {% endif %}
  28. {% if is_recurring and occurrences|length > 0 %}
  29. <ul class="date-recur-occurrences">
  30. {% for item in occurrences %}
  31. <li>{{ item }}</li>
  32. {% endfor %}
  33. </ul>
  34. {% endif %}