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

Use PHP timezone conversor instead of relying on RrdGraphJS #16049

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DeadZombie14
Copy link

This fixes a frontend issue caused by RrdGraphJS: certain timezones will not work properly because this library isnt kept up to date, and as a result will display an incorrect DST time on certain timezones that have changed the way they work, like mine, America/Mexico_City, which was always displaying one hour ahead of what it really is due to an outdate DST configuration.

My solution is to rely on PHP for timezone conversion, we take the unix time and format it to a timezone then output its resulting date string to a Date javascript object.

Display time for America/Mexico_City before this patch:
Capture3

After this patch:
Capture4

This issue does not happen in older versions (before commit #15783), because it used to only rely on the server's PHP timezone.

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

This fixes an issue caused by RrdGraphJS: certain timezones will not work properly because this library isnt kept up to date, and as a result will display an incorrect DST time on certain timezones, like America/Mexico_City.
@CLAassistant
Copy link

CLAassistant commented May 21, 2024

CLA assistant check
All committers have signed the CLA.

@electrocret electrocret requested a review from murrant May 21, 2024 20:45
Copy link
Member

@murrant murrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could fix more things by updating the timezone data:
https://momentjs.com/timezone/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants