HermanMartinus / bearblog

Free, no-nonsense, super fast blogging.
MIT License
2.82k stars 84 forks source link

The actual publish date and the date shown in the blog list are different. #289

Closed dotmanner closed 3 months ago

dotmanner commented 5 months ago

Hi, I'm a Bear blog user from South Korea. I would like to report a minor bug. As you can see in the screenshot, a post created on the morning of the 13th will show up as the 12th in the list. I think this is probably happening to posts I write early in the morning.

스크린샷 2024-06-13 오전 9 38 23 스크린샷 2024-06-13 오전 8 30 58 스크린샷 2024-06-13 오전 8 30 35
HermanMartinus commented 5 months ago

Unfortunately this is a pretty difficult problem to solve without introducing those nasty cookie banners everywhere. In your dashboard, since you've signed up I can reasonably figure out your local timezone and adjust accordingly. But under GDPR rules I can't track timezone for readers without them explicitly opting in for me to set that cookie since technically they're not necessary for the functioning of Bear.

This can also be done using clientside JS instead of cookies, but boy is it a mission to get right (mostly cause I allow blogs to set the format of their date output as well). I'll revisit this in the future, just know that it something I'm aware of and have struggled with :P

dotmanner commented 5 months ago

Thank you! Understood well. I hope one day you will find a good solution. 👍

metbril commented 5 months ago

Out of curiousity. Would it make a difference if a timezone is added in the frontmatter?

HermanMartinus commented 5 months ago

The timezone of the poster or the reader?

metbril commented 5 months ago

The timezone of the author/poster. More or less like Hugo is supporting.

Like:

---
title: Foo Bar
published_date: 2024-06-26T09:23:45+01:00
---
Post content
HermanMartinus commented 3 months ago

This has been resolved. Both the time in the editor and the time displayed is now in the timezone of the browser.