Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

16 řádky
775 B

  1. {# templates/_macros/helpers.html.twig #}
  2. {% macro smart_date(currentDate, todayStr, tomorrowStr, yesterdayStr, months, weekdays) %}
  3. {%- set activStr = currentDate|date('Y-m-d') -%}
  4. {%- set monthName = months[currentDate|date('n') - 1] -%}
  5. {%- if activStr == todayStr -%}
  6. {{ 'app.date.today'|trans }}, {{ currentDate|date('j') }}. {{ monthName }}
  7. {%- elseif activStr == tomorrowStr -%}
  8. {{ 'app.date.tomorrow'|trans }}, {{ currentDate|date('j') }}. {{ monthName }}
  9. {%- elseif activStr == yesterdayStr -%}
  10. {{ 'app.date.yesterday'|trans }}, {{ currentDate|date('j') }}. {{ monthName }}
  11. {%- else -%}
  12. {{ weekdays[currentDate|date('N') - 1] }}, {{ currentDate|date('j') }}. {{ monthName }}
  13. {%- endif -%}
  14. {% endmacro %}