Inconsistent behavior of dojo date method
Hi Team,
I have created a script based calculated value to add 2 business days (weekdays) to one of the dates attribute. Here i have used dojo.date.add method as below
var tempDate = dojo.date.add(SDate, "weekday", 2);
It works fine and adding 2 days by excluding weekends until the SDate is any weekday other than friday. If this SDate is friday, then the result i'm getting is Sunday (ideally the calculated output should be tuesday).
For example:
--> If Input (SDate) is Aug 5, 2020, 1:00 AM, then Result (tempDate) is Aug 7, 2020, 1:00 AM
--> If Input is Aug 6, 2020, 1:00 AM, then Result is Aug 10, 2020, 1:00 AM
--> If Input is Aug 7, 2020, 1:00 AM, then Result is Aug 9, 2020, 1:00 AM --> this should be Aug 11, 2020, 1:00 AM
Initially ,I thought that this issue is with Fridays only. But when i increase the No.of days from 2 to 3, then this issue appears for Thursday and friday also.
And if i go on increasing this no.of days,then the issue is adding up to other weekdays as well.
Has anyone observed similar issue or Am i doing anything wrong here..? Please suggest