You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably due to the while loop in the businessDaysAdd method. It proceeds to the next day, reduces the days to add by one if that next day is a business day, and repeats until days to add reach zero.
When the starting date was invalid, no day will ever be a business day and the remaining days will never decrease.
My advice would be changing line 23 in index.js from
while (daysRemaining > 0) {
to something like
while (currentDay.isValid() && daysRemaining > 0) {
plus adding a test.
The text was updated successfully, but these errors were encountered:
When doing the following, I get an infinite loop:
This is probably due to the while loop in the
businessDaysAdd
method. It proceeds to the next day, reduces the days to add by one if that next day is a business day, and repeats until days to add reach zero.When the starting date was invalid, no day will ever be a business day and the remaining days will never decrease.
My advice would be changing line 23 in index.js from
to something like
plus adding a test.
The text was updated successfully, but these errors were encountered: