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

Fix month calculation in relativeDateToDateRange #1297

Closed

Conversation

alhridoy
Copy link

Fixes Issue #761

This PR addresses the issue where the relativeDateToDateRange function was incorrectly calculating the date for the previous month when the current date was later than the last day of the previous month.

Changes:

  • Modified the relativeDateToDateRange function to set the day to the first day of the month before subtracting months. This ensures that the function always lands in the correct month, regardless of the number of days in the current month.

This fix should resolve the intermittent test failures we were seeing for 'month' with days < current month days.

Please review and let me know if there are any concerns.

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 3 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want this PR to never become stale, please apply the "Draft" label.

@github-actions github-actions bot added the Stale Stale issue - update or it will be closed label Oct 27, 2023
@github-actions github-actions bot closed this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Stale issue - update or it will be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant