Holiday pay for working the days around it
The rule
A paid holiday is earned by attendance around it: the employee must work their last scheduled day before the holiday and their first scheduled day after it. An absence on either day forfeits the holiday’s pay, unless the day was excused: taken off by the schedule, or approved leave.
Who uses it
Employers whose holiday policy or union contract guards against a long weekend made longer by an unexcused day off: manufacturing, distribution, healthcare.
How the recipe does it
Configuration only: a package (package.toml) of one layer. The holiday
pays its 8 hours; then the standard holiday_attendance step looks at the
scheduled days around it.
[[layer]]id = "holiday-pay"[[layer.step]]id = "holiday"uses = "standard/holiday_pay"params = { time = "8h", category = "holiday" }
[[layer.step]]id = "attendance"uses = "standard/holiday_attendance"params = { category = "holiday", to = "holiday_forfeited" }The scheduled day before is the nearest day before the holiday with a
scheduled shift and no holiday of its own, within within days (7); the
day after, the same forward. A scheduled day with no work, not taken off
and not on approved leave, moves the holiday’s pay to to, a category the
tenant sets up as not paid: the hours stay on the timecard, saying why.
A day before in the pay period before is checked there: the step looks
back 14 days, into the period before. A day after in a later pay period
cannot be known yet: the holiday’s period holds the pay, in held
(holiday_held, a category the tenant sets up as not paid), and the
period that holds the day after decides it on that day: the held hours
are paid as holiday when the day was worked or excused, or go to to. A
change to that day later (a forgotten punch added) works it out again,
and where its period is closed, the open period is adjusted as for any
late change. The holiday’s own period never changes for it.
Parameters
| Parameter | Meaning (default) |
|---|---|
category | The holiday pay’s category. |
to | Where forfeited holiday pay goes. |
held | Where pay waiting on a day after in a later period goes (holiday_held). |
within | How many days either side are looked through (7; 1 to 7). |
What the scenarios show
worked-the-days-around-it: Wednesday and Friday worked; Thanksgiving pays 8 hours.missing-the-day-after-forfeits-it: Friday not worked; the 8 hours are forfeited.approved-leave-the-day-after-keeps-it: Friday on approved vacation; the 8 hours are paid.the-day-before-in-the-period-before: Labor Day opens its pay period; the Friday before, in the period before, was missed: forfeited.the-day-after-in-the-next-period-is-decided-there: a Friday holiday ends its period: held there, and paid on the Monday after, worked, in the next period.paid-daily-the-day-before-is-periods-back: paid daily, Labor Day is a period of its own and the Friday before, worked, three periods back: the step reads as many periods before as it looks back through, holds the pay, and Tuesday, worked, pays it.a-late-punch-on-the-day-after-earns-the-held-pay: the Monday shows no work when its period closes, so the pay is forfeited there; the punches added later adjust the open period by 8 hours of holiday and take the forfeiture away.
Legal note
This is a common way companies set holiday eligibility; check the rules where you operate and the contract that applies. Some contracts excuse other absences (a doctor’s note, bereavement): record them as leave or a schedule change, and the rule treats the day as excused.
Get the recipe
The recipe’s package and its scenarios are in the example packages repository: attendance/holiday_pay_if_worked_around. Test it, or your own copy of it, with hourctl attend test, and publish it with hourctl attend pkg publish.
The policy package
The package’s layers, with the standard steps each one runs and their settings:
name = "holiday_pay_if_worked_around"version = "1.0.0"description = "A holiday pays 8 hours to people who worked their last scheduled day before it and their first scheduled day after it; missing either, unexcused, forfeits it."
# A holiday pays 8 hours as holiday, a category set up as not worked.# Then, where the last scheduled workday before the holiday or the first# after it was not worked, and not taken off or on approved leave, the# holiday's pay goes to holiday_forfeited, a category set up as not paid.[[layer]]id = "holiday-pay"[[layer.step]]id = "holiday"uses = "standard/holiday_pay"params = { time = "8h", category = "holiday" }
[[layer.step]]id = "attendance"uses = "standard/holiday_attendance"params = { category = "holiday", to = "holiday_forfeited" }Scenarios
Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).
The same holiday, and Monday July 6 shows no work when its week closes: the held 8 hours go to holiday_forfeited there. Monday's punches, forgotten, are added on July 14: the closed week is worked out again, Monday was worked, and the open week is adjusted by the 8 hours of holiday the late change earns, and the forfeiture it takes away
description = "The same holiday, and Monday July 6 shows no work when its week closes: the held 8 hours go to holiday_forfeited there. Monday's punches, forgotten, are added on July 14: the closed week is worked out again, Monday was worked, and the open week is adjusted by the 8 hours of holiday the late change earns, and the forfeiture it takes away"
punch = [ { at = "2026-07-02 08:00", kind = "in" }, { at = "2026-07-02 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 7, from = "2026-06-29" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_held"worked = falsepaid = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[holiday]]id = "company"name = "Company day"month = 7day = 3
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[close]]period = "2026-07-06"recorded = "2026-07-13 08:00"
[[correction]]recorded = "2026-07-14 09:00"by = "supervisor"reason = "forgot to punch"add = { id = "in6", at = "2026-07-06 08:00", kind = "in" }
[[correction]]recorded = "2026-07-14 09:00"by = "supervisor"reason = "forgot to punch"add = { id = "out6", at = "2026-07-06 16:00", kind = "out" }
[expect]week = "2026-07-13"allocations = [ "2026-07-14 untimed holiday 8.00", "2026-07-14 untimed holiday_forfeited -8.00", "2026-07-14 untimed work 8.00",]
[expect.period]day = "2026-07-06"allocations = [ "2026-07-06 untimed holiday_forfeited 8.00",]Wednesday is worked; the Friday after Thanksgiving is approved vacation: an excused absence keeps the holiday's 8 hours
description = "Wednesday is worked; the Friday after Thanksgiving is approved vacation: an excused absence keeps the holiday's 8 hours"
punch = [ { at = "2026-11-25 08:00", kind = "in" }, { at = "2026-11-25 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 14, from = "2026-11-16" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[category]]id = "vacation"worked = false
[[holiday]]id = "thanks"name = "Thanksgiving"month = 11weekday = "thursday"n = 4
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[leave]]category = "vacation"days = { "2026-11-27" = "8h" }recorded = "2026-11-02 09:00"
[[approval]]subject = "leave:lv1:2026-11-27"stage = "approval"decision = "approve"recorded = "2026-11-02 09:00"
[expect]week = "2026-11-23"allocations = [ "2026-11-25 08:00-16:00 work 8.00", "2026-11-26 untimed holiday 8.00", "2026-11-27 untimed vacation 8.00",]Wednesday is worked but the Friday after Thanksgiving, a scheduled day, is not, and was not taken off or on leave: the holiday's 8 hours are forfeited
description = "Wednesday is worked but the Friday after Thanksgiving, a scheduled day, is not, and was not taken off or on leave: the holiday's 8 hours are forfeited"
punch = [ { at = "2026-11-25 08:00", kind = "in" }, { at = "2026-11-25 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 14, from = "2026-11-16" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[holiday]]id = "thanks"name = "Thanksgiving"month = 11weekday = "thursday"n = 4
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[expect]week = "2026-11-23"allocations = [ "2026-11-25 08:00-16:00 work 8.00", "2026-11-26 untimed holiday_forfeited 8.00",]Paid daily: Labor Day is a pay period of its own, and the Friday before it, worked, is three periods back. The step looks back 14 days, through as many periods before as that reaches: Friday was worked, Tuesday after it too, and Labor Day's 8 hours are paid
description = "Paid daily: Labor Day is a pay period of its own, and the Friday before it, worked, is three periods back. The step looks back 14 days, through as many periods before as that reaches: Friday was worked, Tuesday after it too, and Labor Day's 8 hours are paid"
punch = [ { at = "2026-09-04 08:00", kind = "in" }, { at = "2026-09-04 16:00", kind = "out" }, { at = "2026-09-08 08:00", kind = "in" }, { at = "2026-09-08 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 1, from = "2026-08-31" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_held"worked = falsepaid = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[holiday]]id = "labor"name = "Labor Day"month = 9weekday = "monday"n = 1
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[expect.period]day = "2026-09-07"allocations = [ "2026-09-07 untimed holiday_held 8.00",]
[expect]week = "2026-09-07"allocations = [ "2026-09-07 untimed holiday_held 8.00", "2026-09-08 untimed holiday 8.00", "2026-09-08 08:00-16:00 work 8.00",]Paid weekly from Monday, a company holiday on Friday July 3 ends its pay period, and the first scheduled day after it, Monday July 6, is the next period's. The holiday's period cannot know yet: its 8 hours are held, in holiday_held, not paid. The next period holds Monday, which was worked: it pays the 8 hours as holiday, on Monday
description = "Paid weekly from Monday, a company holiday on Friday July 3 ends its pay period, and the first scheduled day after it, Monday July 6, is the next period's. The holiday's period cannot know yet: its 8 hours are held, in holiday_held, not paid. The next period holds Monday, which was worked: it pays the 8 hours as holiday, on Monday"
punch = [ { at = "2026-07-02 08:00", kind = "in" }, { at = "2026-07-02 16:00", kind = "out" }, { at = "2026-07-06 08:00", kind = "in" }, { at = "2026-07-06 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 7, from = "2026-06-29" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_held"worked = falsepaid = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[holiday]]id = "company"name = "Company day"month = 7day = 3
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[expect]week = "2026-06-29"allocations = [ "2026-07-02 08:00-16:00 work 8.00", "2026-07-03 untimed holiday_held 8.00",]
[expect.period]day = "2026-07-06"allocations = [ "2026-07-06 untimed holiday 8.00", "2026-07-06 08:00-16:00 work 8.00",]Paid weekly from Monday: Labor Day is the first day of its pay period, and the Friday before, a scheduled day, is the period before's and was not worked. The step reads the period before's days: Labor Day's 8 hours are forfeited
description = "Paid weekly from Monday: Labor Day is the first day of its pay period, and the Friday before, a scheduled day, is the period before's and was not worked. The step reads the period before's days: Labor Day's 8 hours are forfeited"
punch = [ { at = "2026-09-08 08:00", kind = "in" }, { at = "2026-09-08 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 7, from = "2026-08-31" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[holiday]]id = "labor"name = "Labor Day"month = 9weekday = "monday"n = 1
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[expect]week = "2026-09-07"allocations = [ "2026-09-07 untimed holiday_forfeited 8.00", "2026-09-08 08:00-16:00 work 8.00",]Scheduled Monday to Friday: Wednesday before Thanksgiving and the Friday after are worked, so the holiday pays its 8 hours
description = "Scheduled Monday to Friday: Wednesday before Thanksgiving and the Friday after are worked, so the holiday pays its 8 hours"
punch = [ { at = "2026-11-25 08:00", kind = "in" }, { at = "2026-11-25 16:00", kind = "out" }, { at = "2026-11-27 08:00", kind = "in" }, { at = "2026-11-27 16:00", kind = "out" },]
[policy]zone = "America/Chicago"pay_periods = { every_days = 14, from = "2026-11-16" }
[[category]]id = "holiday"worked = false
[[category]]id = "holiday_forfeited"worked = falsepaid = false
[[holiday]]id = "thanks"name = "Thanksgiving"month = 11weekday = "thursday"n = 4
[[shift_definition]]id = "days"start = "08:00"end = "16:00"days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[expect]week = "2026-11-23"allocations = [ "2026-11-25 08:00-16:00 work 8.00", "2026-11-26 untimed holiday 8.00", "2026-11-27 08:00-16:00 work 8.00",]