Holiday Request System - how do I calculate the number of business hours/days

Hi guys,

Im building a new holiday request system for our company in Knack, but having trouble trying to figure out the best way to calculate the time properly.

So here's the challenge. 

Have a date field (Timer based) where someone selects a date range as to when they want to take off. So say for example Bob puts in a date range of the 1st March (8am) to 3rd March (10pm) - I just want to calculate the amount of business hours that needs to be deducted from their entitlement.

Open to suggestions if there is a better way to do this - but appreciate any help!




I've been building an HR app for some time and haven't completely cracked this one yet. So far, I am able to work out the number of working days between the dates (which have to be in separate fields by the way - I then update a single from to date field for calendar purposes) - it does this by comparing the employee's working pattern with each day in the period of leave in Javascript.

The thing I've yet to crack is how to allow for Public Holidays...

If you'd like to see the app it's available as a demo here.