HermanMartinus / bearblog

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

Add timezone settings #273

Closed pimoore closed 4 months ago

pimoore commented 4 months ago

I read someone's post in the Discovery feed about having issues with posts showing up in the wrong day (I'm assuming they were scheduled). I tested by making a test post at 9:02 EST, but the published_date + time in the CSV shows five hours ahead at 2:02. I'm assuming Bearblog is based on GMT by that metric, but there should be a setting to change the timezone to one's local region.

HermanMartinus commented 4 months ago

While there is no universal timezone setting (this gets really messy, really quickly), you can specify the published_date with a time and timezone (although the timezone isn't mentioned in the docs).

Here's an example for EST: published_date: 2024-02-08 09:02-05:00

In terms of the discovery feed, things are ranked by the amount of upvotes they get per 24 hour period, so it doesn't affect the scoring system. It's also why it shows up as X hours/days ago instead of the actual published date.

Unfortunately this isn't easy to do server side, but it is possible to add JS to your blog that looks for <time> elements and converts the date into the date of the browser's timezone.

I hope this all helps :)