
Anonymous Community User asked a question.
calculate business hours between two dates but limit each day to 8 hours
Hello I need to compute for business hours between two dates but would need to limit each day to 8 hours. Business Hours = 8am - 5pm Lunch Hour = 12pm - 1pm DateTimeStart = March 1 8am DateTimeEnd = March 2 9am Total business hours = 9 Has anyone encountered something like this? Have searched the help center but I didn't see anything there. I've managed to get the total hours to work but couldn't find a way to limit each day to 8 hours var d1 = moment(@Start Time); var d2 = moment(@End Time); var hours = d2.diff(d1, 'hours'); hours; Total hours = 25