datetime.html.twig

{#
/**
 * Returns HTML for a date / time.
 *
 * Available variables
 * - timestamp: (optional) A UNIX timestamp for the datetime attribute. If the
 *   datetime cannot be represented as a UNIX timestamp, use a valid datetime
 *   attribute value in attributes.datetime.
 * - text: (optional) The content to display within the <time> element. Set
 *   'html' to TRUE if this value is already sanitized for output in HTML.
 *   Defaults to a human-readable representation of the timestamp value or the
 *   datetime attribute value using format_date().
 * - attributes: (optional) HTML attributes to apply to the <time> element.
 *   A datetime attribute in 'attributes' overrides the 'timestamp'. To
 *   create a valid datetime attribute value from a UNIX timestamp, use
 *   format_date() with one of the predefined 'html_*' formats.
 * - html: (optional) Whether 'text' is HTML markup (TRUE) or plain-text
 *   (FALSE). Defaults to FALSE. For example, to use a SPAN tag within the
 *   TIME element, this must be set to TRUE, or the SPAN tag will be escaped.
 *   It is the responsibility of the caller to properly sanitize the value
 *   contained in 'text' (or within the SPAN tag in aforementioned example).
 *
 * @see template_preprocess_datetime()
 * @see http://www.w3.org/TR/html5-author/the-time-element.html#attr-time-datetime
 */
#}
{# @todo Revisit once http://drupal.org/node/1825952 is resolved. #}
<time class="{{ attributes.class }}" {{ attributes }}>{{ html ? text|raw : text|escape }}</time>
2 theme calls to datetime.html.twig
DateTimeDefaultFormatter::viewElements in drupal/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php
Builds a renderable array for a field value.
template_preprocess_aggregator_summary_item in drupal/core/modules/aggregator/aggregator.pages.inc
Processes variables for aggregator summary item templates.

File

drupal/core/modules/system/templates/datetime.html.twig
View source
  1. {#
  2. /**
  3. * Returns HTML for a date / time.
  4. *
  5. * Available variables
  6. * - timestamp: (optional) A UNIX timestamp for the datetime attribute. If the
  7. * datetime cannot be represented as a UNIX timestamp, use a valid datetime
  8. * attribute value in attributes.datetime.
  9. * - text: (optional) The content to display within the <time> element. Set
  10. * 'html' to TRUE if this value is already sanitized for output in HTML.
  11. * Defaults to a human-readable representation of the timestamp value or the
  12. * datetime attribute value using format_date().
  13. * - attributes: (optional) HTML attributes to apply to the <time> element.
  14. * A datetime attribute in 'attributes' overrides the 'timestamp'. To
  15. * create a valid datetime attribute value from a UNIX timestamp, use
  16. * format_date() with one of the predefined 'html_*' formats.
  17. * - html: (optional) Whether 'text' is HTML markup (TRUE) or plain-text
  18. * (FALSE). Defaults to FALSE. For example, to use a SPAN tag within the
  19. * TIME element, this must be set to TRUE, or the SPAN tag will be escaped.
  20. * It is the responsibility of the caller to properly sanitize the value
  21. * contained in 'text' (or within the SPAN tag in aforementioned example).
  22. *
  23. * @see template_preprocess_datetime()
  24. * @see http://www.w3.org/TR/html5-author/the-time-element.html#attr-time-datetime
  25. */
  26. #}
  27. {# @todo Revisit once http://drupal.org/node/1825952 is resolved. #}
  28. <time class="{{ attributes.class }}" {{ attributes }}>{{ html ? text|raw : text|escape }}</time>