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

Blog Post date always shows current month, not published date's month #16

Open
guategeek opened this issue Dec 10, 2017 · 2 comments
Open

Comments

@guategeek
Copy link

Blog Posts on the Receptar theme always display as being published on the current month, the rest of the date (day and year) are correct but the month is not.

I don't know twig so can't figure out how to fix this.

@kvandenbrande
Copy link

Same issue, solved it by editing /user/themes/receptar/templates/partials/blog_item.html.twig
around line 40 change:
<div class="entry-meta entry-meta-bottom"> <time datetime="{{ 'MONTHS_OF_THE_YEAR'|ta(post.date|date('n') - 1) }} {{ page.date|date("d, Y") }}" class="entry-date entry-meta-element published" title="{{ 'MONTHS_OF_THE_YEAR'|ta(post.date|date('n') - 1) }} {{ page.date|date("d, Y") }}" itemprop="datePublished">{{ 'MONTHS_OF_THE_YEAR'|ta(post.date|date('n') - 1) }} {{ page.date|date("d, Y") }}</time>

to:
<div class="entry-meta entry-meta-bottom"> <time datetime=" {{ page.date|date("M d Y") }}" class="entry-date entry-meta-element published" title=" {{ page.date|date("M d Y") }}" itemprop="datePublished"> {{ page.date|date("M d Y") }} </time>
Depending how you like time format.

@jonata
Copy link

jonata commented Oct 5, 2020

Yes, I had this problem too. So the problem is that we were using blog.date instead of page.date. But probably blog should pass the correct date anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants