Skip to content
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

Posted x ago section in comments is incorrect for new comments #141

Open
minusQuantumNeko opened this issue Dec 9, 2022 · 9 comments
Open
Labels
Backend For Issues or Pull Requests related to Backend Bug Something isn't working Code For Issues or Pull Requests related to code Fix Needed For Issues that need to be fixed Frontend For Issues or Pull Requests related to Frontend

Comments

@minusQuantumNeko
Copy link
Member

If new comment is created, it will say it was posted 59 minutes ago, when it's actually not true, and tooltip shows actual post time (in GMT)
image

@minusQuantumNeko minusQuantumNeko added Bug Something isn't working Fix Needed For Issues that need to be fixed Code For Issues or Pull Requests related to code Frontend For Issues or Pull Requests related to Frontend Backend For Issues or Pull Requests related to Backend labels Dec 9, 2022
@Tanza3D
Copy link
Member

Tanza3D commented Dec 9, 2022

on local servers it's even more wonky, on my local test it says 3 hours. i think it's because on the database side the date is stored as whatever timezone the server's in, but on the local side it reads it as UTC or something

@minusQuantumNeko
Copy link
Member Author

on local servers it's even more wonky, on my local test it says 3 hours. i think it's because on the database side the date is stored as whatever timezone the server's in, but on the local side it reads it as UTC or something

But the thing is even like that, the time will be incorrect if we count difference between timezones

@Tanza3D
Copy link
Member

Tanza3D commented Dec 9, 2022

hm right i gotcha, hmm, gotta think abot that some more

@FujiwaraSatomi
Copy link
Contributor

Why not implement it in JavaScript

@Tanza3D
Copy link
Member

Tanza3D commented Dec 14, 2022

it is https://github.com/Osekai/osekai/blob/main/global/js/comment_system.js#L143

the issue i think at this point is the server is sending a time in UTC+1, but then the code is interpreting it as simply UTC so it thinks it's posted an hour in the future. shouldn't be too impossible to fix

@FujiwaraSatomi
Copy link
Contributor

FujiwaraSatomi commented Dec 15, 2022

If the server always sending a time in UTC+1, you can use the setHours function in JavaScript to set it to UTC like this

@Tanza3D
Copy link
Member

Tanza3D commented Dec 15, 2022

the better way to do it is to just store dates in UTC instead.

@FujiwaraSatomi
Copy link
Contributor

ic😅

@minusQuantumNeko minusQuantumNeko linked a pull request Dec 26, 2022 that will close this issue
@Tanza3D Tanza3D removed a link to a pull request Dec 28, 2022
@Tanza3D
Copy link
Member

Tanza3D commented Jun 2, 2023

this is fixed... temporarily...
in a few months, the timezone will change again, and the dates will go back to being horribly wrong...
maybe, i don't know with the new server at this point...
we will see...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend For Issues or Pull Requests related to Backend Bug Something isn't working Code For Issues or Pull Requests related to code Fix Needed For Issues that need to be fixed Frontend For Issues or Pull Requests related to Frontend
Projects
None yet
Development

No branches or pull requests

3 participants