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
[x] Terms and conditions reflect the current change
[ ] Contains enough appropriate tests
[x] If aimed at production, writes a new summary in whatsnew/whatsnew-pt-PT
[x] Properly adds an entry in changelog.md with the change
[x] If PR includes UI updates/additions, its description has screenshots
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
whatsnew/whatsnew-pt-PT
changelog.md
with the change