Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes


Accepted answer

Permanent link

 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.

Geoffrey Clemm selected this answer as the correct answer

0 votes

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). 

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,495
× 1,325

Question asked: Aug 06 '20, 9:27 a.m.

Question was seen: 642 times

Last updated: Aug 07 '20, 10:48 a.m.

Confirmation Cancel Confirm