Skip to content

A holiday entered after its day is flagged

The rule

Public holidays are usually known well before their day. When one is entered after its day has ended (it was forgotten, or announced late by a decree), what was already worked out for that day changes: leave on it is not charged, people who worked it get the premiums, a no-show is gone. Somebody should see that, and decide whether the holiday was forgotten or announced late, because the answer decides what is owed: Time and Attendance cannot know it, so it does not guess.

Who uses it

Employers with holiday premiums or leave on holidays, in places where holidays are sometimes declared at short notice, and payroll teams who want a day changed after the fact in front of an approver before it is paid.

How the recipe does it

Configuration only: a package (package.toml) of one layer with the standard holiday_entered_after step in the exceptions stage.

[[layer]]
id = "late-holidays"
[[layer.step]]
id = "entered-after"
uses = "standard/holiday_entered_after"
params = {}

Each holiday says when its date was first given (announced: when the setup revision that gave it was stored). A day that observes a holiday whose announced is after the day ended raises the exception holiday_entered_after_the_day (name it with kind). The approver sees it on the day; a policy may block approval on it. A holiday whose announcement is not known (entered before this was kept) raises nothing. The events that change because of the holiday say which holiday, who put it and why (because), so what the approver sees comes with who entered it and the reason they gave.

Holidays that are treated differently (for example regular holidays and special non-working days) are told apart as everywhere else: holidays = ["id", ...].

Parameters

ParameterMeaning
kindThe exception raised (default holiday_entered_after_the_day).
holidaystrue (the default): every holiday the day observes; a list: those; false: none.

What the scenarios show

  • announced-after-the-day: the holiday of Thursday 8 October was announced on the 14th: the Thursday is flagged.
  • announced-before-the-day: announced on 1 October: nothing is flagged.

Whether a holiday entered late is owed is for the law where you operate and the contract that applies; this only makes sure someone looks.

Get the recipe

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

holiday_entered_after/package.toml
name = "holiday_entered_after"
version = "1.0.0"
description = "A day that observes a holiday entered after the day ended is flagged for the approver: whether it was forgotten or announced late is a person's call, the system gives the fact and does not guess."
[[layer]]
id = "late-holidays"
[[layer.step]]
id = "entered-after"
uses = "standard/holiday_entered_after"
params = {}

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 holiday of Thursday 8 October is announced on the 14th, after its day: the Thursday is raised as entered after it, for the approver
scenarios/announced-after-the-day.toml
description = "The holiday of Thursday 8 October is announced on the 14th, after its day: the Thursday is raised as entered after it, for the approver"
[policy]
zone = "America/Chicago"
[[holiday]]
id = "harvest"
name = "Harvest day"
date = "2026-10-08"
announced = "2026-10-14T15:00:00Z"
[[punch]]
at = "2026-10-08 08:00"
kind = "in"
[[punch]]
at = "2026-10-08 16:00"
kind = "out"
[expect]
week = "2026-10-05"
exceptions = [{ kind = "holiday_entered_after_the_day", at = "2026-10-08 00:00" }]
The holiday of Thursday 8 October is announced on the 1st, before its day: nothing is raised
scenarios/announced-before-the-day.toml
description = "The holiday of Thursday 8 October is announced on the 1st, before its day: nothing is raised"
[policy]
zone = "America/Chicago"
[[holiday]]
id = "harvest"
name = "Harvest day"
date = "2026-10-08"
announced = "2026-10-01T15:00:00Z"
[[punch]]
at = "2026-10-08 08:00"
kind = "in"
[[punch]]
at = "2026-10-08 16:00"
kind = "out"
[expect]
week = "2026-10-05"
exceptions = []