Skip to main content
Participant
Nov 18, 2026 1:23 PM UTC
Question

Timesheet PDF form: split total hours into regular and overtime (40-hour week)

I’m sharing the calculation scripts I use for a timesheet PDF form. Make sure TotalHours comes first in the calculation order (Tools > Prepare a Form > More > Set Field Calculation Order).

Regular hours field (custom calculation script):
var t = Number(this.getField("TotalHours").value) || 0;
event.value = Math.min(t, 40);

Overtime hours field:
var t = Number(this.getField("TotalHours").value) || 0;
event.value = Math.max(0, t - 40);

For example, 46 hours gives 40 regular and 6 overtime. To check what that overtime is worth in pay, a free overtime pay calculator lets you enter the rate and hours. Has anyone found a cleaner way to handle weeks where the normal hours are not 40?

    1 reply

    Karl Heinz  Kremer
    Community Expert
    Community Expert
    Nov 18, 2026 2:01 PM UTC

    Store the number of hours in a week in a variable. This way, you can adjust that when you are dealing with e.g. a 4 day week. The calculation will then adjust accordingly. 

    Translate