Update and stick to using moment-timezone to fix DST #8853
Merged
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.
Fixes #8690
Short description of what this resolves:
Fix the critical CET(Central European Time)/CEST(Central European Summer Time) issue, DST(Daylight Saving Time) related.
Reasoning:
The said behavior illustrated in issue #8690 is most likely caused by the version conflict of moment.js.
First principle thinking, the time zone database IANA is updated periodically, and the author of moment-timezone keeps track of it and releases. So the first step is to update moment-timezone to receive the latest IANA support.
Then, according to his's words, the wrong way to import moment-timezone will very likely cause multiple versions of moment loaded, leading to conflict. And he suggests checking the status of moment.js by running
yarn why moment
. Here it is,In our case, the usage of moment
occurs many times. However, the imported moment in this way does not ensure the right tz. By refactoring all of such usages to
import moment from moment-timezone
, the eureka moment arouses. March 26 2023 is the beginning of CEST. Comparison:March 25 2023,
March 26 2023,
Bingo!
No need to consider js/temporal. The journey to dig into the world time zone domain really impresses this commiter significantly.
Changes proposed in this pull request:
Checklist
development
branch.