The Function is returning correct date till 1 year of business days from current Date ,but we are getting issue if we are giving more than 1 year of business days from current Date.
Example: if we are taking currentDate as 10-Sep-2019, and executing addDays function:
@(Pega-RULES:BusinessCalendar).addDays(@CurrentDate("MM/dd/yyyy","PST"),261,true,USDefault) , getting output as 9-Sep-2020.Similarly,if am changing the numberOfDays to 262,263 and 264 days, getting 28-May-2020, 29-May-2020, 30-May-2020 respectively instead of 10-Sep-2020,11-Sep-2020,12-Sep-2020. Why this is happening after 1 year from current date ? Please post your solution.
In this case if you need to use only the addDays function only then the following local change will work.
You need to create multiple calendar instances that you are passing in the function. That i s if you want the addDays() to calculate days for next three years then you need to create three calendar instances of same name that you are passing in the function with start dates as starting of three years.
Example: In the above example you are passing "USDefault" then you need to create three or more calendar instances for this as per your requirement. Let me know if you have any doubts...