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

hotfix: make week handle timezone changes #1217

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

limwa
Copy link
Member

@limwa limwa commented Apr 1, 2024

This pull request makes the week util class handle timezone changes properly.

Dart's standard lib, when asked to add or subtract 7 days from a DateTime will, instead, add/subtract the equivalent of 7 days in seconds.

This results in wrong calculations when the week contains a timezone change. By copying the dates with isUtc: true, the calculations become correct, since UTC does not have timezone changes.

Review checklist

  • Terms and conditions reflect the current change
  • Contains enough appropriate tests
  • If aimed at production, writes a new summary in whatsnew/whatsnew-pt-PT
  • Properly adds an entry in changelog.md with the change
  • If PR includes UI updates/additions, its description has screenshots
  • Behavior is as expected
  • Clean, well-structured code

@limwa limwa requested review from bdmendes, LuisDuarte1 and a team April 1, 2024 22:33
@limwa limwa requested a review from a team April 1, 2024 22:36
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Merging #1217 (a14aa0c) into master (6f37a0d) will increase coverage by 1%.
Report is 2 commits behind head on master.
The diff coverage is 75%.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1217   +/-   ##
======================================
+ Coverage      17%     17%   +1%     
======================================
  Files         229     229           
  Lines        6975    6979    +4     
======================================
+ Hits         1144    1155   +11     
+ Misses       5831    5824    -7     

@limwa limwa requested a review from bartekpacia April 1, 2024 22:43
@limwa limwa merged commit 24242f7 into master Apr 1, 2024
6 checks passed
@limwa limwa deleted the hotfix/make-week-handle-timezone-changes branch April 1, 2024 22:53
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.

3 participants