Shift Work calculation methodology

How First Calc models rotating shifts. This page describes the implemented calculation contracts — not marketing accuracy guarantees or professional certifications.

Cycle arithmetic

A schedule stores an ordered cycle of shift-definition ids. Cycle length is the number of positions. Position for a civil date is computed from the first day of cycle (anchor), cycle offset, and day distance using modulo arithmetic.

First day of cycle (anchor)

The anchor date is the inclusive cycle origin. With offset 0, the anchor maps to cycle position 0. A non-zero offset skips that many positions from the origin before the pattern is read. The anchor is not always the first working day.

Assignment starts versus days with work

An assignment start is the civil date where a duty begins. A cycle position without a new assignment is a slot where the repeating pattern does not start a new duty — it is not automatically a full day off if a long duty from an earlier day is still running. Days with work (occupied civil dates) are every civil day overlapped by the resolved work interval, including overnight carry-in. Full days off (fully free civil dates) have no work overlap. Statistics report assignment starts, days with work, and full days off separately.

Continuous elapsed rest versus nominal civil spacing

Continuous elapsed rest is the actual time between resolved work-interval instants: from one duty end to the next duty start after timezone resolution. Nominal civil spacing describes the scheduled wall-clock or civil-time separation people usually name in everyday language (for example “about 96 hours off” in a 48/96 label). These quantities may differ across daylight-saving transitions. Pattern names such as 24/48, 48/96, and 24/72 refer to nominal civil spacing; they do not guarantee that continuous elapsed rest is always identical to that label in every timezone.

Nominal versus elapsed hours

Nominal duration comes from the shift definition (scheduled length). Elapsed duration is the timezone-resolved interval length. Clipped elapsed minutes respect the reporting range bounds. Break minutes may be recorded on definitions; the current calculator does not subtract them from clipped elapsed hours.

Overnight and multi-day shifts

Duties longer than the remaining portion of a civil day continue into following civil dates. Calendar cells can show assignment starts, carry-in occupancy, or fully free days. For 48/96-style examples, a nominal 48-hour duty with about 96 hours of nominal civil rest spacing still depends on civil-time and DST semantics for the exact calendar footprint and continuous elapsed rest.

Timezone and DST handling

Each schedule has an IANA timezone. Interval resolution uses that zone so DST transitions can change elapsed length relative to nominal minutes. Fixed public examples on this site often use UTC for a stable reference and state that choice beside the tables.

Reporting boundaries

Reporting ranges are inclusive civil-date windows with a reporting timezone. Public date bounds and internal expansion bounds follow the Architecture contracts (including lookback for carry-in). Nonexistent calendar dates are rejected.

Which patterns appear in the tools

Only independently checked, releasable patterns are offered in the UI. Complex named rotations remain unavailable until they pass that check. Pattern pages always reference those releasable ids.

Calculation limitations

  • No payroll, overtime multipliers, or statutory leave engines.
  • No claim that a generic pattern equals a specific agency roster.
  • Annual example tables depend on the first day of cycle, offset, and timezone — they must not be quoted as universal constants.
  • Schedules can be saved in the browser and restored from a JSON backup. PDF, print, ICS, and CSV exports are generated locally in the browser — personal schedules are not uploaded.

How definitions are kept honest

Calculation behavior is covered by automated tests. Formula or contract changes require a cited source or focused tests. Public page revision markers change only after meaningful content updates — not for artificial freshness.