NIAEFEUP / uni

Mobile app designed to help students of the University of Porto to manage their academic life.
GNU General Public License v3.0
46 stars 15 forks source link

hotfix: make week handle timezone changes #1217

Closed limwa closed 6 months ago

limwa commented 6 months ago

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

codecov[bot] commented 6 months ago

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 ```diff @@ Coverage Diff @@ ## master #1217 +/- ## ====================================== + Coverage 17% 17% +1% ====================================== Files 229 229 Lines 6975 6979 +4 ====================================== + Hits 1144 1155 +11 + Misses 5831 5824 -7 ```