Closed oim37 closed 1 year ago
@oim37 the timestamp is accessible via this.page.mtime
in Twig. You can do something like this in the Twig code to present it nicely:
Last updated on {{ this.page.mtime|date('l jS F, Y') }}
I'm very grateful, but he's unlike {{ this.page.title}} where it takes data from the page, it shows the modification date of the template file itself.
On all pages, today's date of editing the template file itself is displayed, and the date of editing the pages themselves is completely different.
I try {{page.mtime|date('l jS F, Y')}} and it workin good for static pages showing - Saturday 5th August, 2023
thanks for the help.
The only thing is that when switching languages, I have 5 of them, it always writes in English:
Saturday 5th August, 2023 Monday 13th February, 2023
Whoops, sorry, my bad! Good job on working out the right one! :)
I'm not sure how translations work with dates unfortunately. @mjauvin might be able to assist with this.
use international format:
{{ page.mtime | date('Y-m-d') }}
Yes, I did just that, just for interest, I searched (September) in winter files and find this path
domain.tld/modules/system/lang/
with complete translations.
more domain.tld/modules/system/lang/de/client.php
'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
or
more domain.tld/modules/system/lang/ru/client.php
'months' => ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
That's me, simply, thank you!
Hello,
help please, can't find how to show this data on frontend? Want to show this near title - this is very useful information - shows the relevance of the article.
Thank you very much in advance.