Skip to content

Fix business days calculations#236

Open
jedrekdomanski wants to merge 1 commit into
bokmann:developfrom
jedrekdomanski:develop
Open

Fix business days calculations#236
jedrekdomanski wants to merge 1 commit into
bokmann:developfrom
jedrekdomanski:develop

Conversation

@jedrekdomanski

@jedrekdomanski jedrekdomanski commented Sep 1, 2025

Copy link
Copy Markdown

Reference

#196

Description

When calculating the next business day using BusinessDays#calculate_after, the method incorrectly advances one extra day if the starting point is a weekend or holiday.

Example (before fix):

# Saturday, Sept 6, 2025
1.business_day.after(Date.parse("2025-09-06"))
# => Tuesday, Sept 9, 2025 (❌ incorrect)

Expected behavior:

The method should stop on the first business day, which is Monday, Sept 8, 2025.

# Saturday, Sept 6, 2025
1.business_day.after(Date.parse("2025-09-06"))
# => Monday, Sept 8, 2025 (✅  correct)

@rodrigofhm

Copy link
Copy Markdown

Thank you for the fix @jedrekdomanski !

We forked your repo!

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.

2 participants