Support Article
BussinessCalendar.addDays function adds an extra day to weekends
SA-19285
Summary
When days are added to Saturday or Sunday in BussinessCalendar.addDays(), an extra day is added in the result.
Error Messages
Not Applicable
Steps to Reproduce
Add 1 day to weekend days (Saturday or Sunday) and check the result.
Root Cause
An issue in custom application code or rules.
Resolution
The addDays() functions evaluates input and calculate results in three steps:
- Evaluate a DateTime value for the starting date.
- The date specified is evaluated to determine if the date is a business day. (The time of day is not evaluated.)
- If the specified day is a business day, then that date is used for calculation.
- If the specified day is not a business day, then the date is rolled forward, using the calendar provided, to the next business day.
The date resulting from this step, which is used in the following steps, might not be the original date specified, the date rolls forward and you see one day extra.
Published February 11, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.