A yearly limit on what is earned
The rule
Paid sick leave is earned at an hour for every 30 hours worked, but no more than 40 hours of it are earned in a calendar year. Once the year’s 40 hours are earned, further hours worked that year earn nothing; a new year starts the count again.
This limits what is earned, not the balance: sick leave used during the
year does not make room to earn more that year. (A limit on the balance,
where earning stops at a cap and starts again once leave is used, is the
accrue step’s own cap: the sick_leave_one_per_thirty recipe shows
it.)
Who uses it
Employers under a paid sick leave law that lets them limit what is earned in a year (many set it at 40 or 48 hours), with or without a separate cap on the balance.
How the recipe does it
Configuration only: a package (package.toml) of one layer, with monthly
pay periods and balances kept from September 1, 2025. Two business rules,
each a step of its own:
[[layer.step]]id = "earn"uses = "standard/accrue"params = { category = "sick", earn = "1h", per = "30h" }[[layer.step]]id = "yearly"uses = "standard/earn_limit"params = { category = "sick", limit = "40h" }accrue earns sick leave for the hours worked. earn_limit counts what
was earned of sick in the calendar year, through the end of each pay
period, and forfeits as it is earned what passes 40 hours. Its year is a
repeating period: the calendar year by default, { every = "1y", starts = "hire" } for each anniversary of hire, { every = "1y", starts = "leave_year" } for the policy’s leave year.
What your setup needs
Set up before you adopt the recipe; the recipe’s steps read them by name, and adopting it is refused, with a list of what is missing, until they exist.
- A balance called
sick: an accrual category. The recipe earns into it, takes from it or reads it.
The scenarios show each as it was set up for them.
Parameters
| Step | Parameter | Meaning |
|---|---|---|
earn_limit | category | The accrual category. |
earn_limit | limit | The most earned in a year (40h). |
earn_limit | year | The year it counts (default the calendar year). |
What the scenarios show
earned-past-40-hours-in-the-year-is-not-added: 9 hours a month, 36 by April; of May’s 9, 5 are forfeited, and the balance is 40 hours.a-new-year-earns-again: 40 hours earned by December 2025; January’s 10 hours are added.leave-taken-does-not-reopen-the-yearly-limit: 16 hours used in May make no room: May’s 10 hours are past 40 in the year and forfeited.a-year-from-the-anniversary-of-hire: counting the year from each anniversary, January 2026’s hours are still in the year from January 6, 2025: forfeited.
Legal note
Sick leave laws set their own earning rates, yearly limits, balance caps and carryover rules, and some let an employer give the whole year’s leave at its start instead. Check the rules where you operate.
Get the recipe
The recipe’s package and its scenarios are in the example packages repository: attendance/earning_capped_each_year. 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 = "earning_capped_each_year"version = "1.0.0"description = "Sick leave earned at an hour for every 30 hours worked, at most 40 hours a calendar year: what is earned past 40 in the year is not added."
# What the tenant must have set up for the recipe: the steps read these by name.[needs]accrual_categories = ["sick"]
# Monthly pay periods; balances kept from September 1, 2025. Sick leave is# earned at an hour for every 30 hours worked; what is earned past 40 hours# in a calendar year is forfeited as it is earned.[[layer]]id = "sick-leave"settings = { pay_periods = { month_days = [1] }, accruals = { since = "2025-09-01" } }[[layer.step]]id = "earn"uses = "standard/accrue"params = { category = "sick", earn = "1h", per = "30h" }[[layer.step]]id = "yearly"uses = "standard/earn_limit"params = { category = "sick", limit = "40h" }Scenarios
Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).
300 hours worked each month from September to December 2025 earn the year's 40 hours. January's 10 hours are in a new year: they are added, and the balance is 50 hours
description = "300 hours worked each month from September to December 2025 earn the year's 40 hours. January's 10 hours are in a new year: they are added, and the balance is 50 hours"
[policy]zone = "America/Los_Angeles"
[[category]]id = "sick"worked = false
[[accrual_category]]id = "sick"uses = ["sick"]
[[measure]]id = "hours"kind = "duration"
[[employment]]effective = "2025-01-06"kind = "hired"
[[labor]]workday = "2025-09-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2025-10-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2025-11-14"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2025-12-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2026-01-15"measure = "hours"quantity = "300h"category = "work"
[expect.period]day = "2026-01-15"accruals = ["2026-01-01 sick earned 10h"]balances = { sick = "50h" }An employer that counts the year from each anniversary of hire (January 6): 300 hours worked each month from September to December 2025 earn 40 hours in the year from January 6, 2025; January 2026's 10 hours are earned on January 1, still in that year: forfeited
description = "An employer that counts the year from each anniversary of hire (January 6): 300 hours worked each month from September to December 2025 earn 40 hours in the year from January 6, 2025; January 2026's 10 hours are earned on January 1, still in that year: forfeited"
[policy]zone = "America/Los_Angeles"
[[category]]id = "sick"worked = false
[[accrual_category]]id = "sick"uses = ["sick"]
[[measure]]id = "hours"kind = "duration"
[[employment]]effective = "2025-01-06"kind = "hired"
[[labor]]workday = "2025-09-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2025-10-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2025-11-14"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2025-12-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2026-01-15"measure = "hours"quantity = "300h"category = "work"
# The year from each anniversary of hire.[[layer]]id = "anniversary"[[layer.step]]id = "yearly"change = "params"params = { year = { every = "1y", starts = "hire" } }
[expect.period]day = "2026-01-15"accruals = ["2026-01-01 sick earned 10h", "2026-01-01 sick forfeited -10h"]balances = { sick = "40h" }270 hours worked each month earn 9 hours of sick leave: 36 hours from January to April. May's 9 would make 45 in the year: 5 of them are forfeited, and the balance is 40 hours
description = "270 hours worked each month earn 9 hours of sick leave: 36 hours from January to April. May's 9 would make 45 in the year: 5 of them are forfeited, and the balance is 40 hours"
[policy]zone = "America/Los_Angeles"
[[category]]id = "sick"worked = false
[[accrual_category]]id = "sick"uses = ["sick"]
[[measure]]id = "hours"kind = "duration"
[[employment]]effective = "2025-01-06"kind = "hired"
[[labor]]workday = "2026-01-15"measure = "hours"quantity = "270h"category = "work"
[[labor]]workday = "2026-02-13"measure = "hours"quantity = "270h"category = "work"
[[labor]]workday = "2026-03-13"measure = "hours"quantity = "270h"category = "work"
[[labor]]workday = "2026-04-15"measure = "hours"quantity = "270h"category = "work"
[[labor]]workday = "2026-05-15"measure = "hours"quantity = "270h"category = "work"
[expect.period]day = "2026-05-15"accruals = ["2026-05-01 sick earned 9h", "2026-05-01 sick forfeited -5h"]balances = { sick = "40h" }The limit is on what is earned in the year, not on the balance: 40 hours earned by April, 16 used in May; May's 10 hours earned are still past 40 in the year, and are forfeited
description = "The limit is on what is earned in the year, not on the balance: 40 hours earned by April, 16 used in May; May's 10 hours earned are still past 40 in the year, and are forfeited"
[policy]zone = "America/Los_Angeles"
[[category]]id = "sick"worked = false
[[accrual_category]]id = "sick"uses = ["sick"]
[[measure]]id = "hours"kind = "duration"
[[employment]]effective = "2025-01-06"kind = "hired"
[[labor]]workday = "2026-01-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2026-02-13"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2026-03-13"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2026-04-15"measure = "hours"quantity = "300h"category = "work"
[[labor]]workday = "2026-05-15"measure = "hours"quantity = "300h"category = "work"
[[leave]]id = "s1"category = "sick"days = { "2026-05-18" = "8h", "2026-05-19" = "8h" }recorded = "2026-05-18 07:00"
[[approval]]subject = "leave:s1:2026-05-18"stage = "approval"decision = "approve"recorded = "2026-05-18 08:00"
[expect.period]day = "2026-05-15"accruals = ["2026-05-18 sick used -8h", "2026-05-19 sick used -8h", "2026-05-01 sick earned 10h", "2026-05-01 sick forfeited -10h"]balances = { sick = "24h" }