Examples

Telescope night booking

Built with the mantine-calendar skill

Proposal
November 2026
MoTuWeThFrSaSu

A night belongs to its start date; the run ends after its final morning.

Bright nights are for spectrographs only · up to 7 consecutive nights.

Free

Allocated

Unavailable

Pending

Approved

Cannot end run

Selected

Preview

Run

Choose the first night on the calendar

Nights

—

Hours of darkness

—

Remaining quota before

7 nights

Remaining quota after

7 nights

Your requests this semester

  • AST-104

    Thu, Dec 10 – Fri, Dec 11 · 2 nights

    approved
  • AST-205

    Sun, Dec 27 – Sun, Dec 27 · 1 nights

    pending

Build the night booking page of a small observatory: astronomers request observing nights on the main telescope.

Data:

  • the observing semester runs from the 1st of the current month for 6 months
  • 5 hard-coded research proposals (code, principal investigator, instrument: imaging camera, spectrograph or photometer, and a quota of nights for the semester); the current user leads 2 of them
  • the moon phase of every night is computed from the date (no library), and each night has hard-coded sunset, astronomical dusk and dawn times that shift through the semester
  • about 25 nights already allocated to other proposals, a few maintenance blocks of 2–4 nights each with a reason ("Mirror recoating", "Dome repair"), generated relative to today

Calendar:

  • one month at a time on desktop, with the moon phase and the hours of darkness in each night cell; the user can switch between the months of the semester only
  • nights within 3 days of the full moon are bright: only the spectrograph can use them, and for imaging and photometer proposals they look unavailable
  • allocated nights look taken; maintenance nights look unavailable, and hovering, focusing or clicking one shows its reason under the calendar
  • a night belongs to the date it starts on (the run of the night of 12 March ends on the morning of 13 March)

Request:

  • the user picks one of their proposals, then a run of consecutive nights on the calendar; while the first night is picked, nights that cannot end the run (it would cross a taken or maintenance night, or a bright night for that instrument, or exceed the remaining quota) look unavailable
  • next to the calendar: the run, the number of nights, the total hours of darkness, the remaining quota of the proposal before and after, and a "Request nights" button
  • the request lists the user's earlier requests of the semester with their status (pending, approved), and requested nights are shown on the calendar
  • the information shown on each night is read by screen readers

Value:

  • "Request nights" shows a short notification and displays the request and the proposal's remaining quota as JSON under the component

The component is shown on a demo page that already has a title: do not add a page title or intro text.

Write tests for the component.