Business day and holiday calculator for a range of dates.

edited October 2015 in DevShare Downloads
This example contains custom JavaScript code that demonstrates how to calculate the number of business days that fall within a range of dates.



The sample function "businessDaysCalculator()" within the report returns an object that contains various values about the given business days.



For example:



Array of holiday dates that fall within the date range:

obj.holidaysInDateRange = Thu Jan 01 2015 00:00:00 GMT-0600 (CST),Mon Jan 19 2015 00:00:00 GMT-0600 (CST)



Total number of business days that fall within the date range:

obj.totalBusinessDays = 12



Total number of days that fall within the date range:

obj.totalDays = 20



Total number of holidays that fall within the date range:

obj.totalHolidays = 2

...



Additional holidays and floating dates can be added/removed within the code or function parameter for added flexibility.



The attached example was created with BIRT Report Designer Professional 4.2.3 (iHub 3.0)

Matthew L.
Actuate is now OpenText
http://www.actuate.com

Sign In or Register to comment.