Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-10745: Hide article timestamp #1065

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion templates/module/helfi-news-item/node--news-item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@
{{ published_at|format_date('publication_date_format') }}
</time>

{% if modified_at is not empty %}
{#
UHF-10745: Hide modified field if it is in between timestamps when we
updated all news articles. Data between these intervals is useless.
#}
{% if modified_at is not empty and (
modified_at < date('2024-09-25T14:30:00', 'Europe/Helsinki')|date('U') or
modified_at > date('2024-09-25T15:15:00', 'Europe/Helsinki')|date('U')
)
%}
{% set html_modified_at = modified_at|format_date('custom', 'Y-m-d') ~ 'T' ~ modified_at|format_date('custom', 'H:i') %}
<time datetime="{{ html_modified_at }}" class="content-date__datetime content-date__datetime--updated">
{% if date(modified_at) < date('-365days') %}
Expand Down