Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

TwentyFifteen date format

Solved by pamtbaau View solution

Started by Sjoerd Smeets 8 years ago · 3 replies · 1081 views
8 years ago

Hello, in the blog section the month in which the post was made appears to be hardcoded before displaying the date/time as set in the config.
I already saw in Github that this was mentioned, but there was no solution for the problem.

Does anyone know how to solve this?

section form partials/blog_item.html.twig

TWIG

        <span class="posted-on">
            <time class="entry-date published updated" datetime="{{ page.date|date(config.system.pages.dateformat.short) }}">{{ 'MONTHS_OF_THE_YEAR'|ta(page.date|date('n') - 1) }} {{ page.date|date(config.system.pages.dateformat.default) }}</time> 
        </span>
8 years ago Solution

@SjoerdSmeets I believe the solution is mentioned in the issue itself on GitHub.

To rephrase the proposed solution:
Open file '/user/themes/twentyfifteen/templates/partials/blog_item.html.twig' and remove the following on line 70:

TWIG
{{ 'MONTHS_OF_THE_YEAR'|ta(page.date|date('n') - 1) }}

If the proposed solution didn't work for you somehow, please let me know.

Please be advised to make the changes in an inherited theme. If you don't, the changes will be lost when the theme gets updated by the authors. Which is not likely considering the commit rate, but a good practice anyway...

last edited 11/22/18 by pamtbaau
8 years ago

Apparently didn't saw that the solution was in that ticket.

Thanks that worked for me!

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by MarkP, 2 weeks ago
3 193 2 weeks ago
Themes & Styling · by TomW, 2 weeks ago
0 111 2 weeks ago
Themes & Styling · by themetman, 3 weeks ago
1 206 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 324 3 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1523 3 weeks ago