# Is there a way to calculate the number of business days between two dates - just exclude the weekends?

 0 Abdelrahman Hassan (19●13) | asked May 01 '18, 11:16 a.m. Is there a way to calculate the number of business days between two dates excluding the weekends using a calculated-value script. I can get the number of days but I don't know how to exclude the weekends. ---------------------------------- dojo.provide("com.rm.ProjectDaysValueProvider"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); dojo.require("dojo.date"); dojo.require("dojo.date.stamp"); (function() {     dojo.declare("com.rm.ProjectDaysValueProvider", null, {         getValue: function(attribute, workItem, configuration) {                  // Get the start date and the end date and compute the difference in days.         var startDate= dojo.date.stamp.fromISOString(workItem.getValue(WorkItemAttributes.StartDate));         var EndDate= dojo.date.stamp.fromISOString(workItem.getValue(WorkItemAttributes.EndDaet)); //var startDate = workItem.getValue('StartDate'); //var endDate = workItem.getValue('EndDaet'); //var numOfProjectDays = " "; if (startDate == null) { Return " "; } else {     if (EndDate == null) return " ";                 else return dojo.date.difference(startDate, EndDate, "day");         }     }); })();

 0 Donald Nong (14.4k●3●14) | answered May 01 '18, 9:06 p.m. Basically you're asking the same question as this one. https://jazz.net/forum/questions/248138/calculating-the-number-of-working-days-between-two-given-dates You can try the "interval" argument in the dojo.date.difference() function, and choose the value "weekday". https://dojotoolkit.org/reference-guide/1.9/dojo/date.html Abdelrahman Hassan selected this answer as the correct answer Comments Abdelrahman Hassan commented May 28 '18, 10:50 p.m. | edited May 28 '18, 10:52 p.m. Thank you Donald. Your answer was really useful. I was able to calculate the days difference between two dates excluding weekends. I'm adding the script in a different answer.