fix twig date and currency filter deprecation

This commit is contained in:
Tchama 2020-09-05 15:38:41 +02:00
parent 92f3926bbf
commit e34afe1ee6

View File

@ -56,12 +56,12 @@
<td> <td>
{{ f.type|budget_element_type_display(family) }} {{ f.type|budget_element_type_display(family) }}
</td> </td>
<td>{{ f.amount|localizedcurrency('EUR') }}</td> <td>{{ f.amount|format_currency('EUR') }}</td>
<td> <td>
{% if f.endDate is not null %} {% if f.endDate is not null %}
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': f.startDate|localizeddate('long', 'none'), '%endDate%': f.endDate|localizeddate('long', 'none') } ) }} {{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': f.startDate|format_date('long', 'none'), '%endDate%': f.endDate|format_date('long', 'none') } ) }}
{% else %} {% else %}
{{ 'Valid since %startDate%'|trans( { '%startDate%': f.startDate|localizeddate('long', 'none') } ) }} {{ 'Valid since %startDate%'|trans( { '%startDate%': f.startDate|format_date('long', 'none') } ) }}
{% endif %} {% endif %}
</td> </td>
<td> <td>
@ -90,7 +90,7 @@
{{ 'Total'|trans }} {{ 'Total'|trans }}
</td> </td>
<td> <td>
{{ total|localizedcurrency('EUR') }} {{ total|format_currency('EUR') }}
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@ -113,7 +113,7 @@
<td>{{ result.label }}</td> <td>{{ result.label }}</td>
<td> <td>
{% if result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_CURRENCY') %} {% if result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_CURRENCY') %}
{{ result.result|localizedcurrency('EUR') }} {{ result.result|format_currency('EUR') }}
{% elseif result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_PERCENTAGE') %} {% elseif result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_PERCENTAGE') %}
{{ result.result|round(2, 'ceil') ~ '%' }} {{ result.result|round(2, 'ceil') ~ '%' }}
{% else %} {% else %}