1.We are building a resource management application where We have a requirement to populate the difference of days based on the start date and end date based on Calender. 2.We are using the OOTB function(R-U-F) @differencebetweendays(startdate,enddate,true,Calender)but see discrepancy in no of days. 3. We have added additional day because the function API returns zero when the start date and end date are same. 4. Other requirement is to populate the end date based on the Start date once the number of days are changed using the Calender. We couldn't find any appropriate function to achieve point 4. Likewise need assistance on how the point 2 can be achieved considering the Holidays in a calendar. Could you please help us in achieving the same.
***Updated by Moderator: Vidyaranjan. Added #helpme, user seeking assistance***
SR-A76132 was raised for this usecase but since this requires design assistance, Ali has posted here.
The requirement is to count the number of days between a start date and end date for a timesheet.
On using @differencebetweendays(startdate,enddate,true,Calender), the start date is not counted. This is as per design.
Example: @differencebetweendays(11/7/2016,12/7/2016,true,Calender) returns 1 but user is looking for the value to be returned as 2.
For this, we can have an adder logic that is a declare expression on a property to add 1 to the value returned by the @differencebetweendays api if the days selected is a weekday.
However, after this, there is an issue wherein if the user selects a day that is marked as a closed day in the calendar, it gets counted.
Example: if 6th july is one of the closed days in the calender and with the adder logic, @differencebetweendays(5/7/2016,6/7/2016,true,Calender) will return 2 when it is supposed to return 1 since 6th July should not be counted.
What i think is the adder logic will need to be modified to include all the closed days manually but is there a better way to implement the user scenario?
Posted: 5 years ago
Posted: 20 Jul 2016 7:10 EDT
Praneeth Purighalla (PraneethPurighalla)
Lead System Architect - Pega Consulting
If the RUF differenceBetweenDays is working as designed, I believe it needs to be enhanced to accept a flag to indicate if both startDate and endDate need to be included in the calculation of the output. Having a declare expression isn't the right way to go about this because of the problem with closed days that you mentioned. It is the RUF's job to consider closed days.