Skip to content

Vacation earned by years of service

The rule

Vacation is earned on hours worked, at a rate that grows with service: for example an hour for every 40 worked in the first five years, an hour and a half from the fifth anniversary, two hours from the tenth. The new rate starts on the anniversary, not at the next pay period or year.

Who uses it

Employers with a paid time off or vacation plan that rewards tenure, which is most of them: tiers of 2, 3 and 4 weeks a year by years of service are common, earned per hour worked for hourly staff.

How the recipe does it

Configuration only: the package (package.toml) has one layer for everyone with the standard accrue step, earning by tiers of years of service:

[[layer]]
id = "vacation"
[[layer.step]]
id = "vacation"
uses = "standard/accrue"
params = { window = "day", category = "vacation", tiers = [
{ years = 0, earn = "1h", per = "40h" },
{ years = 5, earn = "1h 30m", per = "40h" },
{ years = 10, earn = "2h", per = "40h" },
] }

For each day the step takes the person’s employment that day: nothing is earned on a day they are not employed. Their years of service are counted from their hire date to the day (the anniversary counts the year), the tier is the last one reached, and the day’s worked time earns at its rate, to the millisecond, so an anniversary in the middle of a pay period changes the rate from that day. With window = "day" each day’s accrual is an entry of its own, dated the day it was earned.

Service counts from the current hire by default; a policy that counts employment before a break gives the step service_from = "first_hired", and one that limits the balance gives it a cap, in a layer of its own:

[[layer]]
id = "service"
order = 20
[[layer.step]]
id = "vacation"
change = "params"
params = { service_from = "first_hired", cap = "80h" }

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 vacation: 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

ParameterMeaning
categoryThe accrual category earned.
tiersFrom the fewest years up: years, and the rate as earn for every per.
window"day": each day’s accrual its own entry.
service_from"hired" (the latest hire, default) or "first_hired".
capThe most the balance holds; earning stops there.
countsThe categories counted (default every worked one).

What the scenarios show

  • the-fifth-anniversary-mid-week: Monday and Tuesday earn at the first tier, Wednesday (the anniversary) on at the second.
  • a-rehire-starts-again: a rehire’s service counts from the new hire.
  • earlier-service-when-the-policy-counts-it: with first_hired, the same person is at the ten-year tier.
  • nothing-earned-once-terminated: the day a termination takes effect earns nothing.
  • the-cap-stops-the-tiers-earning: with a cap of 80 hours, the anniversary’s higher tier earns only what fits under it, and the days after earn nothing.

This is a common way companies implement tiered vacation accrual; check the rules where you operate, and your plan’s own terms for rehires, leaves of absence and part-time staff.

Get the recipe

The recipe’s package and its scenarios are in the example packages repository: attendance/vacation_by_service. 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:

vacation_by_service/package.toml
name = "vacation_by_service"
version = "1.0.0"
description = "Vacation earned on hours worked at a rate that steps up with years of service, changing on the work anniversary itself."
# What the tenant must have set up for the recipe: the steps read these by name.
[needs]
accrual_categories = ["vacation"]
# Everyone: each day's worked time earns vacation at the tier of the
# person's years of service that day, counted from their current hire:
# an hour for every 40 worked, an hour and a half from the fifth
# anniversary, two hours from the tenth. Each day's accrual is its own.
[[layer]]
id = "vacation"
[[layer.step]]
id = "vacation"
uses = "standard/accrue"
params = { window = "day", category = "vacation", tiers = [
{ years = 0, earn = "1h", per = "40h" },
{ years = 5, earn = "1h 30m", per = "40h" },
{ years = 10, earn = "2h", per = "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).

First hired in 2015, gone from 2020, hired again in 2024: service counts from the current hire, so the rehire earns at the first tier, 12 minutes for 8 hours
scenarios/a-rehire-starts-again.toml
description = "First hired in 2015, gone from 2020, hired again in 2024: service counts from the current hire, so the rehire earns at the first tier, 12 minutes for 8 hours"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
accruals = { since = "2026-10-05" }
[[accrual_category]]
id = "vacation"
uses = ["vacation"]
[[employment]]
effective = "2015-03-02"
kind = "hired"
[[employment]]
effective = "2020-06-30"
kind = "terminated"
[[employment]]
effective = "2024-01-08"
kind = "hired"
[expect.period]
day = "2026-10-05"
accruals = ["2026-10-05 vacation earned 12m"]
The same rehire, under a policy that counts employment before the break (service_from = first_hired): eleven years since 2015, so the ten-year tier, 2 hours for every 40, 24 minutes for 8 hours
scenarios/earlier-service-when-the-policy-counts-it.toml
description = "The same rehire, under a policy that counts employment before the break (service_from = first_hired): eleven years since 2015, so the ten-year tier, 2 hours for every 40, 24 minutes for 8 hours"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
accruals = { since = "2026-10-05" }
[[accrual_category]]
id = "vacation"
uses = ["vacation"]
[[employment]]
effective = "2015-03-02"
kind = "hired"
[[employment]]
effective = "2020-06-30"
kind = "terminated"
[[employment]]
effective = "2024-01-08"
kind = "hired"
# Service counted from the first hire, employment before a break included.
[[layer]]
id = "first-hired"
order = 20
[[layer.step]]
id = "vacation"
change = "params"
params = { service_from = "first_hired" }
[expect.period]
day = "2026-10-05"
accruals = ["2026-10-05 vacation earned 24m"]
A termination effective Thursday: Wednesday's work earns, and the hours punched on Thursday, the first day not employed, earn nothing
scenarios/nothing-earned-once-terminated.toml
description = "A termination effective Thursday: Wednesday's work earns, and the hours punched on Thursday, the first day not employed, earn nothing"
punch = [
{ at = "2026-10-07 08:00", kind = "in" }, { at = "2026-10-07 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 10:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
accruals = { since = "2026-10-05" }
[[accrual_category]]
id = "vacation"
uses = ["vacation"]
[[employment]]
effective = "2024-01-08"
kind = "hired"
[[employment]]
effective = "2026-10-08"
kind = "terminated"
[expect.period]
day = "2026-10-05"
accruals = ["2026-10-07 vacation earned 12m"]
A cap of 80 hours on the balance, with the tiers: hired October 7, 2021, the week starts with 79 hours 30 minutes. Monday and Tuesday earn their 12 minutes each at the first tier; Wednesday, the fifth anniversary, would earn 18 at the second but only 6 fit under the cap; Thursday and Friday earn nothing. The balance stops at exactly 80 hours
scenarios/the-cap-stops-the-tiers-earning.toml
description = "A cap of 80 hours on the balance, with the tiers: hired October 7, 2021, the week starts with 79 hours 30 minutes. Monday and Tuesday earn their 12 minutes each at the first tier; Wednesday, the fifth anniversary, would earn 18 at the second but only 6 fit under the cap; Thursday and Friday earn nothing. The balance stops at exactly 80 hours"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 16:00", kind = "out" },
{ at = "2026-10-07 08:00", kind = "in" }, { at = "2026-10-07 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 16:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 16:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
accruals = { since = "2026-10-01" }
[[accrual_category]]
id = "vacation"
uses = ["vacation"]
[[employment]]
effective = "2021-10-07"
kind = "hired"
[[accrual_adjustment]]
category = "vacation"
workday = "2026-10-01"
amount = "79h 30m"
reason = "balance brought over from the old system"
# A balance of at most 80 hours.
[[layer]]
id = "cap"
order = 20
[[layer.step]]
id = "vacation"
change = "params"
params = { cap = "80h" }
[expect.period]
day = "2026-10-05"
accruals = [
"2026-10-05 vacation earned 12m",
"2026-10-06 vacation earned 12m",
"2026-10-07 vacation earned 6m",
]
balances = { vacation = "80h" }
Hired October 7, 2021: Monday and Tuesday of the week of October 5, 2026 are in the fourth year and earn at an hour for every 40 (12 minutes a day); from Wednesday, the fifth anniversary, an hour and a half (18 minutes a day)
scenarios/the-fifth-anniversary-mid-week.toml
description = "Hired October 7, 2021: Monday and Tuesday of the week of October 5, 2026 are in the fourth year and earn at an hour for every 40 (12 minutes a day); from Wednesday, the fifth anniversary, an hour and a half (18 minutes a day)"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 16:00", kind = "out" },
{ at = "2026-10-07 08:00", kind = "in" }, { at = "2026-10-07 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 16:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 16:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
accruals = { since = "2026-10-05" }
[[accrual_category]]
id = "vacation"
uses = ["vacation"]
[[employment]]
effective = "2021-10-07"
kind = "hired"
[expect.period]
day = "2026-10-05"
accruals = [
"2026-10-05 vacation earned 12m",
"2026-10-06 vacation earned 12m",
"2026-10-07 vacation earned 18m",
"2026-10-08 vacation earned 18m",
"2026-10-09 vacation earned 18m",
]
balances = { vacation = "1h 18m" }