Tutorials

Rotating Shift Schedule Generator with CSV and Calendar Export

Generate a date-bounded calendar from explicit shift-cycle labels and person offsets, count daily working coverage, and export CSV and all-day ICS.

Start building for free
2 min readPublished
A four-day shift calendar shows Alex and Blair on offset DAY and OFF phases with daily coverage counts.
On this page

A rotating shift schedule generator can turn a known cycle into a dated calendar with one phase offset per person. Enter the cycle, start date, schedule length, people, and required coverage to see who is assigned each day.

Open the rotating shift schedule tool

Enter a complete cycle and date range

List the labels in order, including OFF, such as DAY, DAY, OFF, OFF. Set the first calendar date as an ISO date (YYYY-MM-DD) and choose a horizon from 1 to 366 days within 2000–2099. The tool accepts up to 100 people and phase offsets from 0 to 10,000. Add each person once and enter a nonnegative integer phase offset. The tool repeats the entire cycle from the supplied start date; it does not infer an employee’s current place in a cycle.

For example, an offset of 2 starts that person at the third cycle label on the chosen date. The formula is labels[(day_index + phase_offset) modulo cycle_length]. Date stepping uses date-only UTC arithmetic so a local daylight-saving transition does not move a calendar day.

Check daily coverage

Set the number of workers required each day. Coverage counts distinct people whose assigned label is not OFF, then compares that count with your required number. It does not optimize staffing or decide whether a pattern is safe or compliant.

Use the coverage result to find dates with too few working people. Coverage is a day-level count; DAY and NIGHT labels are both counted as working and do not prove coverage of a particular time slot. Collect actual time preferences with the availability form template.

Example: a four-day rotation

A four-day shift calendar shows Alex and Blair on offset DAY and OFF phases with daily coverage counts.

AI-generated editorial illustration.

Start on October 6, 2026. Use the cycle DAY, DAY, OFF, OFF, with Alex at offset 0 and Blair at offset 2. Require one working person per day.

Date Alex Blair Coverage
2026-10-06 DAY OFF 1
2026-10-07 DAY OFF 1
2026-10-08 OFF DAY 1
2026-10-09 OFF DAY 1

The schedule contains eight person-date assignments and coverage is one on all four dates. Export the dated schedule as CSV for a spreadsheet or create an all-day ICS calendar for calendar software. Both exports preserve each date and label, including OFF days. ICS events are all-day, transparent calendar labels; they do not block time as appointments.

Build a repeatable schedule app with Atoms

Use Atoms to describe the schedule workflow and build an app around it. The prompt below defines the input contract, calculation, exports, and role checks. Atoms documents Atoms Cloud and connected Supabase as backend choices; select one if the app needs saved schedules. App-user permissions and export access require implementation and verification for the chosen backend. Atoms Cloud overview · Connect Supabase to Atoms · Supabase row-level security

Copy the build prompt into Atoms

Paste the full prompt in your Atoms project chat. It requests both exports and a synthetic case. After implementation, verify a saved edit and read back both exports.

text
Build a rotating shift calendar for a small-team manager who already knows the repeating work cycle. Inputs: an ISO start date and generated dates within 2000–2099, an integer horizon from 1 through 366 days, a comma-separated cycle of 1–31 labels including OFF, 1–100 unique people with integer phase offsets from 0 to 10,000, and a required-worker count from 0 through 100. Use date-only UTC arithmetic. For each person and day, calculate cycle label = labels[(day_index + phase_offset) modulo cycle_length]. Return exactly people_count × day_count schedule rows. Coverage for a date is the count of distinct people whose label is not OFF; compare it with the user-entered required count.

Create stable-ID tables for schedule_versions, people, cycle_patterns, schedule_days, and coverage_requirements. Keep a version of the cycle, start date, horizon, people, offsets, and coverage requirement with every generated schedule. Do not optimize or silently alter the input cycle or offsets.

Provide a dated CSV and an all-day ICS export. Keep every date and assigned label in both exports. Use a date-only/all-day event representation in ICS. Validate ISO dates, horizon bounds, 1–31 nonblank cycle labels, unique person names or IDs, integer nonnegative offsets, and required coverage bounds. Do not use local-time timestamps for date stepping.

Synthetic acceptance example: start 2026-10-06; 4 days; cycle DAY,DAY,OFF,OFF; Alex offset 0; Blair offset 2; required workers 1. Produce 8 person-date rows. On Oct 6 and 7 Alex is DAY and Blair is OFF; on Oct 8 and 9 Alex is OFF and Blair is DAY. Coverage is 1 on each of the four dates. CSV and ICS must preserve those four dates and labels.

This generator applies the supplied pattern. It does not optimize staffing, check labor compliance, or determine worker availability. Do not connect payroll, booking, or payment systems.

Use two app roles: Schedule Owner can edit cycles and generate versions; Team Member can view assigned schedules and export only permitted schedules. Workspace builders are distinct from app users. Choose Atoms Cloud or connected Supabase, not both. Enforce organization, schedule, row, and export permissions on the server. If Supabase is selected, enable and test row-level security for each exposed table. Save a cycle edit as Schedule Owner, reload the app, sign out, and sign in as Team Member. Verify that the saved version persists and that the Team Member sees only permitted schedules. Test permitted and denied edit and export actions for both roles. Report uncompleted checks instead of marking them passed.

Copy the build brief and use it to create your version in Atoms.

Build a shift schedule app

Example rows (CSV) · Application field specification (JSON)

CSV sample input

This input encodes the example above. required_workers applies to each date in the selected horizon.

csv
start_date,days,cycle,person_id,person_name,phase_offset,required_workers
2026-10-06,4,"DAY,DAY,OFF,OFF",P-01,Alex,0,1
2026-10-06,4,"DAY,DAY,OFF,OFF",P-02,Blair,2,1

Review the schedule before sharing

Confirm that the cycle begins on the intended date, every person has the correct offset, and the daily coverage count matches the team’s requirement.

Share this article
Made with Atoms

Your next idea starts here.

Turn what you learned into a working app or website.

Start building for free