Use PHP timezone conversor instead of relying on RrdGraphJS #16049
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 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](https://private-user-images.githubusercontent.com/43389808/332518022-e8668111-94ac-4933-a391-0cfe7d8bd9f9.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5NjQ5ODAsIm5iZiI6MTcxODk2NDY4MCwicGF0aCI6Ii80MzM4OTgwOC8zMzI1MTgwMjItZTg2NjgxMTEtOTRhYy00OTMzLWEzOTEtMGNmZTdkOGJkOWY5LlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDEwMTEyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxODU4ZDBkYjMwMTYwMTZhMmU3ZTg5NDgzMzE1NWY1ZjUxZDQ3ZmEzMGJjMWYyOTg0NzcxOGQ4NDM1MDc1ZmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9wuZLalySV4S9rmxgpUf1Sbl8dqDt-4XfDbEhKZUuUI)
After this patch:
![Capture4](https://private-user-images.githubusercontent.com/43389808/332518437-00b116a0-0252-485b-91fa-506a0b2d1564.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5NjQ5ODAsIm5iZiI6MTcxODk2NDY4MCwicGF0aCI6Ii80MzM4OTgwOC8zMzI1MTg0MzctMDBiMTE2YTAtMDI1Mi00ODViLTkxZmEtNTA2YTBiMmQxNTY0LlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDEwMTEyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjOTU0ZDQxMzAwNmVmNzUxNDYwMTE5ZTc5ZTk0ZTFmNGMyMGM5NzVjYzkyYzJmYTNkNWJkYzNhZDMzZjJjNDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MNcz7XzQeP693V2umOkKMhO8TSxPvLAqzCpIoH3hxy8)
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
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.