Inflectra Customer Forums: Applying business hours to custom reports (Thread) I have created a custom report to display all overdue tasks, and the number of days by which each task is overdue. However, I have only found a way to calculate that number using all days since the overdue date (ex. diffDays(CurrentDateTime(), R.End_Date) . In other words that calculation includes weekends. So if a task is one week overdue, I would like the report to indicate that the task is 5 days overdue, not 7 days. Does anyone know of a way to exclude non-business days from such a calculation? en-US(C) Copyright 2006-2024 Inflectra Corporation.support@inflectra.com/Computers/Software/Project_Management//Computers/Software/Quality_Assurance/KronoDesksupport@inflectra.comhttp://www.inflectra.com/kronodesk/forums/threads120/Support/Forum/spirateam/reports/1820.aspxthreadId=1820Trudy Dobbelaere (tdobbelaere@ariasolutions.com)Business HoursApplying business hours to custom reports I have created a custom report to display all overdue tasks, and the number of days by which each task is overdue. However, I have only found a way to calculate that number using all days since the overdue date (ex. diffDays(CurrentDateTime(), R.End_Date) . In other words that calculation includes weekends. So if a task is one week overdue, I would like the report to indicate that the task is 5 days overdue, not 7 days. Does anyone know of a way to exclude non-business days from such a calculation? Fri, 23 Mar 2018 18:49:03 -04002021-11-16T04:40:54-05:00/Support/Forum/spirateam/reports/1820.aspxmessageId=3253Jim R (donotreply5@kronodesk.net) Hi Trudy, Currently the Release includes the number of working / non-working days and the project Hi Trudy, Currently the Release includes the number of working / non-working days and the project specifies the number of standard working days per month and working hours per day, but they are not tied to the calendar dates directly, they are aggregate. So youd need to hard code the calculation to use 5/7 of the value, or write a custom calculation of some kind. Id also check the Microsoft Entity SQL Docs to see what other functions exist - https://msdn.microsoft.com/en-us/library/system.data.objects.entityfunctions.diffdays(v=vs.110).aspx Regards Jim Mon, 02 Apr 2018 16:42:18 -04002018-04-02T16:42:18-04:00/Support/Forum/spirateam/reports/1820.aspx#reply3253messageId=4193Ilia Poliakov (ilya.polyakov@edetek.com) tdobbelaere , use JavaScript to calculate it at frontend. 1) days = days - 2; // R tdobbelaere , use JavaScript to calculate it at frontend. 1) days = days - 2; // Remove start day if span starts on Sunday but ends before Saturday if (startDay === 0 && endDay !== 6) { days = days - 1; } // Remove end day if span ends on Saturday but starts after Sunday if (endDay === 6 && startDay !== 0) { days = days - 1; } return negative ? -days : days; } ]]> Tue, 16 Nov 2021 04:40:54 -05002021-11-16T04:40:54-05:00/Support/Forum/spirateam/reports/1820.aspx#reply4193