Skip to content

A lunch from an out and an in

The rule

Some clocks have no key for lunch: a person who stops for lunch punches out and punches in again. Within the working day that gap is a lunch, not the end of a shift and the start of another:

  • the break rules count it as a break (a day over 6 hours owes 30 minutes of them);
  • the rule on rest between shifts does not ask 11 hours of the work that follows it;
  • the gap is unpaid, as it was.

A longer gap is two shifts.

Who uses it

Employers with clocks that send only an in and an out, where a lunch is taken between them (BrightLink, for example), under rules on breaks or on rest between shifts.

How the recipe does it

Configuration only: a package (package.toml) of one layer.

[[layer]]
id = "lunch"
[[layer.step]]
id = "gap-lunch"
uses = "standard/gap_lunch"
params = { within = "90m" }
[[layer.step]]
id = "split"
uses = "standard/attribute"
params = { mode = "split" }
[[layer.step]]
id = "rest"
uses = "standard/rest"
params = { at_least = "11h" }
[[layer.step]]
id = "breaks"
uses = "standard/break_time"
params = { tiers = [{ after = "6h", at_least = "30m" }], shortest = "15m" }

gap_lunch takes an out followed within within by an in as a lunch start and a lunch end, so pairing makes a lunch segment of the gap. It runs after direction (it needs known ins and outs) and before join. Where the out is the last punch of a workday and the in the first of the next, they are one gap. as = "break" makes a break of it instead of a lunch.

Which punches it takes

The step takes every plain out and in within within, whatever clock they came from. It does not look at the clock.

  • A punch keyed as lunch at a clock that has lunch keys is a lunch already; the step has nothing to add to it.
  • A business that wants short outs to stay outs does not list the step.
  • A business whose clocks have lunch keys, and that wants lunches only from those keys, does not list the step either.

A layer can still be scoped to sites, by the person’s place:

[[layer]]
id = "gap-lunch"
applies_to = "location in (madrid, lyon)"
[[layer.step]]
id = "gap-lunch"
uses = "standard/gap_lunch"
params = { within = "90m" }

A layer is scoped by the person’s place, not by the clock a punch came from. The clock a punch came from stays on the punch for a business’s own rules to read.

Parameters

ParameterMeaning
withinThe longest gap that is a lunch: "90m".
aslunch (default) or break.

What the scenarios show

  • a-night-shift-with-a-lunch-after-midnight-asks-no-rest: an overnight shift with a lunch after midnight is one shift; no rest is asked of the work after the lunch.
  • a-lunch-meets-the-break-due: 35 minutes meet the 30 due after 6 hours;
  • a-short-gap-does-not-meet-the-break-due: 20 minutes do not, and break_short says so.
  • a-gap-longer-than-within-is-two-shifts: 4 hours between an out and an in are two shifts, and the second is asked its rest.

This is a common way to read a lunch from an out and an in; check the rules where you operate. Whether a lunch is paid, and how long one may be, vary.

Get the recipe

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

lunch_from_out_and_in/package.toml
name = "lunch_from_out_and_in"
version = "1.0.0"
description = "A plain out and an in within 90 minutes are a lunch, so breaks are counted and rest is not asked of the work after it."
# An out followed within 90 minutes by an in is a lunch (unpaid, as the gap
# was); the work around it is one shift. Overnight shifts are cut at midnight,
# the rest between shifts is 11 hours, and a day over 6 hours owes 30 minutes
# of breaks.
[[layer]]
id = "lunch"
[[layer.step]]
id = "gap-lunch"
uses = "standard/gap_lunch"
params = { within = "90m" }
[[layer.step]]
id = "split"
uses = "standard/attribute"
params = { mode = "split" }
[[layer.step]]
id = "rest"
uses = "standard/rest"
params = { at_least = "11h" }
[[layer.step]]
id = "breaks"
uses = "standard/break_time"
params = { tiers = [{ after = "6h", at_least = "30m" }], shortest = "15m" }

Scenarios

Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).

A gap of 4 hours between an out and an in is two shifts: the in at 04:20 starts one 4 hours after the last ended, and too little rest is asked of it
scenarios/a-gap-longer-than-within-is-two-shifts.toml
description = "A gap of 4 hours between an out and an in is two shifts: the in at 04:20 starts one 4 hours after the last ended, and too little rest is asked of it"
punch = [
{ at = "2026-10-05 22:00", kind = "in" },
{ at = "2026-10-06 00:20", kind = "out" }, { at = "2026-10-06 04:20", kind = "in" },
{ at = "2026-10-06 08:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
[expect]
week = "2026-10-05"
exceptions = [{ kind = "rest_too_short", at = "2026-10-06 04:20" }]
The lunch is a break the break rule counts: 7 hours 25 minutes worked with a 35-minute gap between an out and an in meet the 30 minutes due after 6 hours
scenarios/a-lunch-meets-the-break-due.toml
description = "The lunch is a break the break rule counts: 7 hours 25 minutes worked with a 35-minute gap between an out and an in meet the 30 minutes due after 6 hours"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 12:00", kind = "out" },
{ at = "2026-10-05 12:35", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
[expect]
week = "2026-10-05"
exceptions = []
An overnight shift with an out and an in after midnight is one shift with a lunch: no rest is asked of the work after the lunch, though it starts 40 minutes after the out
scenarios/a-night-shift-with-a-lunch-after-midnight-asks-no-rest.toml
description = "An overnight shift with an out and an in after midnight is one shift with a lunch: no rest is asked of the work after the lunch, though it starts 40 minutes after the out"
punch = [
{ at = "2026-10-05 22:00", kind = "in" },
{ at = "2026-10-06 00:20", kind = "out" }, { at = "2026-10-06 01:00", kind = "in" },
{ at = "2026-10-06 06:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
[expect]
week = "2026-10-05"
exceptions = []
A gap of 20 minutes is a lunch, and too short a break: more than 6 hours worked with less than the 30 minutes due raises break_short
scenarios/a-short-gap-does-not-meet-the-break-due.toml
description = "A gap of 20 minutes is a lunch, and too short a break: more than 6 hours worked with less than the 30 minutes due raises break_short"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 12:00", kind = "out" },
{ at = "2026-10-05 12:20", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
]
[policy]
zone = "America/Chicago"
[expect]
week = "2026-10-05"
exceptions = [{ kind = "break_short", at = "2026-10-05 00:00" }]