{% macro displayLabel(value, options) %} {% if value is not empty %} {% if options.previousValue is defined %} {% set value = options.previousValue ~ ' ' ~ value %} {% endif %} {% if options.afterValue is defined %} {% set value = value ~ ' ' ~ options.afterValue %} {% endif %} {{ value|raw }} {% endif %} {% endmacro %} {% macro formatDate(value, options) %} {% set dateFormat = options.dateFormat is defined ? options.dateFormat : 'dd/MM/yyyy' %} {% if value is not empty %} {% if options.timezone is defined %} {% set value = value|localizeddate('none', 'none', null, options.timezone, dateFormat) %} {% else %} {% set value = value|localizeddate('none', 'none', null, null, dateFormat) %} {% endif %} {{ value }} {% endif %} {% endmacro %} {% macro truncateValue(value, options) %} {% if value is not empty and options.truncate is defined %} {% set value = value|truncate(options.truncate, true, '...') %} {% endif %} {{ value }} {% endmacro %} {% macro getCurrentDate(timezone) %} {% set currentDate = "now"|date %} {% import _self as globalF %} {{ globalF.formatDate(currentDate, {'timezone': timezone})}} {% endmacro %} {% macro getCurrentHour(format) %} {% set format = format is defined and format is not empty ? format : 'H:i' %} {% set currentDate = "now"|date %} {% set value = currentDate|date(format) %} {{ value }} {% endmacro %} {% macro getCountry(value, options) %} {% if value is not empty %} {% set value = options.countries[value] %} {{ value }} {% endif %} {% endmacro %} {% macro getAnnexContent(content) %} {{ content|raw }} {% endmacro %}