Skip to content
New issue

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

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

Already on GitHub? # to your account

Date in posts #345

Closed
robertmain53 opened this issue Dec 29, 2020 · 4 comments · Fixed by #400
Closed

Date in posts #345

robertmain53 opened this issue Dec 29, 2020 · 4 comments · Fixed by #400
Assignees
Labels
bug Something isn't working

Comments

@robertmain53
Copy link

Hi,
I've tried Flynt v1.4.0 both locally and on (Apache).
In both cases I have found that the BlockPostHeader shows today's date, not the date on which the post was written or the date on which the post was modified.

@Loualex
Copy link

Loualex commented Jan 2, 2021

I guess you have to use also post.post_date|date instead of post.date.

<time class="meta-date" datetime="{{ post.post_date }}">{{ post.date|date }}</time> {{ dividers.authorDivider|e }}
In datetime its correct.

@steffenbew steffenbew added the bug Something isn't working label Jan 12, 2021
@Auroraboreali-s
Copy link

I've experienced the same issue FlyntWP v1.4.0.

In the Components/BlockPostHeader/index.twig

<time class="meta-date" datetime="{{ post.post_date }}">{{ post.date|date }}</time> {{ dividers.authorDivider|e }}

replaced to

<time class="meta-date" datetime="{{ post.post_date }}">{{ post.date }}</time> {{ dividers.authorDivider|e }}

does the trick and retrieves the publication date instead of the current date, so removing the |date

@aaronmeder
Copy link
Contributor

aaronmeder commented Sep 7, 2021

🌐 We usually have a Translatable Setting to specify a language specific date format (e.g. "dateFormat" in the example) and then use this for processing the date:

{{ post.date|date(dateFormat) }}

@domtra
Copy link
Member

domtra commented Sep 23, 2021

@robertmain53 , @Loualex , @Auroraboreali-s , @aaronmeder , Thanks for all of your input.

This issue is a strange one. As for our normal setup, the code works fine, as is. flyntwp.com always reflects our master branch. And if you check here it does actually display the correct date.

However, we also have run into issues with this not showing the correct date.

I have opened a pull request with a fix that also includes using the general wordpress option for the date format and included the time zone for the datetime stamp. This should all lead to the issue not being present anymore.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants