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

solution and changes for issue #3519 #3556

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matejtuke
Copy link

Issue fix #3519. All tests were successfully passed.

For this issue, I made the following changes:

1. subDays/test.ts

  • - Added a test check for subtracting through UTC time.

2. addDays/test.ts

  • - Added a test check for adding through UTC time.
  • - Deleted offset calculation because it is no longer necessary for the new calculation in addDays/index.ts. (This calculation was used with 4 tests)
  • - Deleted the MINUTE variable because it is not used now.

3. addDays/index.ts

  • - Changed the calculation algorithm from _date.setDate(_date.getDate() + amount) to a new calculation based on milliseconds. (As was described in the issue description)

4. addWeeks/index.ts

  • - Deleted the old calculation based on addDays() function because this function has new calculation logic now. Changed its calculation for its old algorithm logic _date.setDate(_date.getDate() + amount * 7). In fact, there was only 1 line added.
  • - Deleted the import for addDays(), because it is not used now.

5. nextMondays/tests.ts

  • - Only minor editing of details to make the code consistent. Changed months in the dates so they would be consistent with other functions such as: nextTuesday(), nextWednesday(), nextThursday(), nextFriday(), nextSaturday(), nextSunday().

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.

Incorrect day/week calculations across daylight saving boundaries
1 participant