Skip to main content
function timeSurcharge(
   amountPerHour,
   window,
opts?): RuleEntry<"time-cost-surcharge", object & CostRuleOptions>;
Adds a flat surcharge per hour for the portion of a shift that overlaps a time-of-day window.

Parameters

amountPerHour
number
required
Flat surcharge per hour in smallest currency unit
window
required
Time-of-day window
opts
CostRuleOptionsEntity and time scoping

Returns

RuleEntry<"time-cost-surcharge", object & CostRuleOptions> The window supports overnight spans (e.g., 22:00-06:00). The surcharge is independent of the member’s base rate.