Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

TwentyFifteen date format

Solved by pamtbaau View solution

Started by Sjoerd Smeets 8 years ago · 3 replies · 887 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 Sebadamus, 6 days ago
5 148 13 hours ago
Themes & Styling · by martynfoster735, 1 week ago
1 192 1 week ago
Themes & Styling · by Justin Young, 3 weeks ago
1 241 3 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 375 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 744 3 months ago