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
Accepted answer
As far as I can tell, EWM bundles dojo.date as a library. It is not newly developed or something. I don't know if this is the right forum to ask this question. I would suggest to try forums that are more related to dojo. Maybe also search on Stackoverflow.
Comments
It sounds like a dojo bug to me, but I agree with Ralph that your best bet is to raise this question in a dojo forum. I took a look at https://dojo.domo.com/, and didn't see anything there, but it looks like a good forum for this question (in addition to stackoverflow).