Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This might explain why I've been seeing different stats in the calendar vs when I count my posts using my profile.
It seems to calculate the stats using a different time zone then I am providing via the frontend (local dates get converted to unix timestamps) vs which time zone is used in the profile on the frontend. I don't think this necessarily fixes this issue but at least this PR gets the ball rolling regarding discussing this issue.
So I am not sure if we really want to fix the timezone here. But since it's code running on the server, it should have a fixed timezone anyway for everyone. So in the end, this shouldn't change anything? This time zone stuff is really confusing lol. Need to think more about this thus I'll keep this as a draft for now.
Additionally,
withClause
which is used for our charts also does not usetimezone($1)
but might make sense to keep it there as is since it's isolated and I am not aware of any existing confusion there.I also found out that we're using data types with no time zone for our
Item
table because that's the data type Prisma mapsDateTime
to by default..I don't think that's what we want. I think one should always store timestamp with time zone (
timestamptz
).kind of using this pull request to summarize somewhere all confusing stuff I found related to time.