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

Dates are using wrong time for display #145

Closed
fluffy-critter opened this Issue Dec 17, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@fluffy-critter
Collaborator

fluffy-critter commented Dec 17, 2018

Expected Behavior

Entries should be formatted and sorted/paginated using the naive time, as that ostensibly reflects the author's time of day when the post was authored.

Current Behavior

Entries are having their dates formatted/sorted/paginated based on the Publ app's configured timezone instead.

Context

Dates are hard. But this appears to be a regression.

Using the local time was a conscious decision because it's the least-bad approach; if an author changes primary time zones, that should not affect the pagination or display of entries in retrospect, and if an author is visiting another country and writing an entry about being up at 3 AM, the entry had better show the authoring time as being 3 AM!

@fluffy-critter

This comment has been minimized.

Collaborator

fluffy-critter commented Dec 18, 2018

Okay it wasn't a regression so much as an artifact of how dates work in Postgres rather than SQLite - in Postgres they are stored as timezone-aware and retrieved with a specific timezone specified, which is not what we want. Whereas SQLite just stores them as strings.

Since display_date is never used for queries and is only used for display, we now just save it as the isoformat string and let arrow re-parse it into the correct native time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment