Skip to content

Commit

Permalink
Fix format_date years
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Aug 25, 2024
1 parent ff9e2db commit bf084ec
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
42 changes: 42 additions & 0 deletions shared/homeless/migrations/Version20240825150101.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
// SPDX-License-Identifier: BSD-3-Clause

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20240825150101 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update format_date arguments';
}

public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
UPDATE certificate_type
SET content_header_left = replace(
content_header_left,
'format_date(\'none\', \'dd . MM . YYYY\')', 'format_date(\'none\', \'dd . MM . yyyy\')'
),
content_header_right = replace(
content_header_right,
'format_date(\'none\', \'dd . MM . YYYY\')', 'format_date(\'none\', \'dd . MM . yyyy\')'
),
content_body_right = replace(
content_body_right,
'format_date(\'none\', \'dd . MM . YYYY\')', 'format_date(\'none\', \'dd . MM . yyyy\')'
),
content_footer = replace(
content_footer,
'format_date(\'none\', \'dd . MM . YYYY\')', 'format_date(\'none\', \'dd . MM . yyyy\')'
)
SQL);
}

public function down(Schema $schema): void {}
}
4 changes: 2 additions & 2 deletions shared/homeless/templates/pdf/certificate/help.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% block header_right %}
{% if certificate.client %}
{{ certificate.client.fullname }},<br/>
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.YYYY') }}
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.yyyy') }}
<br/>{% endif %}
получает социальную помощь в {{ org_description_short }}.
{% endif %}
Expand All @@ -19,7 +19,7 @@
Благодарим за содействие!<br/><br/>

{% if certificate.dateFrom %}
Дата выдачи: {{ certificate.dateFrom|format_date('none', 'dd.MM.YYYY') }}<br/>
Дата выдачи: {{ certificate.dateFrom|format_date('none', 'dd.MM.yyyy') }}<br/>
Справка действительна в течение 90 дней.
{% endif %}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if certificate.client %}
{{ certificate.client.fullname }},<br/>
регистрационный номер клиента в базе данных: № {{ certificate.client.id }}<br/>
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.YYYY') }}
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.yyyy') }}
<br/>{% endif %}
{% if certificate.client.birthPlace %}Место рождения: {{ certificate.client.birthPlace }}{% endif %}
{% endif %}
Expand All @@ -23,15 +23,15 @@
{% endif %}

{% if certificate.client and certificate.client.createdAt %}
Дата регистрации: {{ certificate.client.createdAt|format_date('none', 'dd.MM.YYYY') }}<br/>
Дата регистрации: {{ certificate.client.createdAt|format_date('none', 'dd.MM.yyyy') }}<br/>
{% endif %}

{% if certificate.dateFrom %}
Дата выдачи справки: {{ certificate.dateFrom|format_date('none', 'dd.MM.YYYY') }}<br/>
Дата выдачи справки: {{ certificate.dateFrom|format_date('none', 'dd.MM.yyyy') }}<br/>
{% endif %}

{% if certificate.dateTo %}
Справка действует до: {{ certificate.dateTo|format_date('none', 'dd.MM.YYYY') }}<br/>
Справка действует до: {{ certificate.dateTo|format_date('none', 'dd.MM.yyyy') }}<br/>
{% endif %}
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions shared/homeless/templates/pdf/certificate/travel.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% block header_right %}
{% if certificate.client %}
{{ certificate.client.fullname }},<br/>
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.YYYY') }}
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.yyyy') }}
<br/>{% endif %}
получает социальную помощь в {{ org_description_short }}.
{% endif %}
Expand All @@ -20,7 +20,7 @@
Благодарим за содействие!<br/><br/>

{% if certificate.dateFrom %}
Дата выдачи: {{ certificate.dateFrom|format_date('none', 'dd.MM.YYYY') }}<br/>
Дата выдачи: {{ certificate.dateFrom|format_date('none', 'dd.MM.yyyy') }}<br/>
Справка действительна в течение 30 дней.
{% endif %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion shared/homeless/templates/pdf/generated_document.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<td>
<p>
{% if document.number %}Исх. {{ document.number }}{% endif %}
{% if document.createdAt %}<br/>От {{ document.createdAt|format_date('none', 'dd.MM.YYYY') }}{% endif %}
{% if document.createdAt %}<br/>От {{ document.createdAt|format_date('none', 'dd.MM.yyyy') }}{% endif %}
{% if document.whom %}<br/>{{ document.whom }}{% endif %}
</p>
</td>
Expand Down

0 comments on commit bf084ec

Please sign in to comment.