Skip to content

Quando

Schedules, rotas, and recurring time rules for TypeScript.

Quando calculates availability and deadlines from recurring rules and exceptions. Use schedules for opening hours, rotas for assignments, and tallies for numeric contributions over time.

Terminal window
npm install @kensio/quando

Quando uses the standard Temporal API. If your runtime needs a polyfill, follow the installation steps before running the examples.

import { schedule, weekdays } from "@kensio/quando";
const openingHours = schedule({ zone: "Europe/London" })
.open(weekdays(), "09:00-17:00")
.closed("2026-12-25")
.setHours("2026-12-24", "09:00-15:00");

This schedule opens Monday to Friday from 09:00 to 17:00. It closes on Christmas Day and replaces Christmas Eve’s hours with 09:00 to 15:00. Later calls override earlier ones for the periods they select.

const placed = Temporal.ZonedDateTime.from(
"2026-03-13T16:55[Europe/London]",
);
openingHours.isOpen(placed);
// true
openingHours.nextOpenInterval(placed.add({ hours: 2 }))?.start?.toString();
// 2026-03-16T09:00:00+00:00[Europe/London]
openingHours
.addOpenTime(placed, Temporal.Duration.from({ hours: 3 }))
?.toString();
// 2026-03-16T11:55:00+00:00[Europe/London]

At 16:55 on Friday, the office is open for five more minutes. The next opening after Friday evening is Monday at 09:00. Adding three open hours uses the remaining Friday minutes and finishes on Monday at 11:55.

The schedule API also measures open time within a date range.

API Use it for
schedule Opening hours and other open or closed periods
rota Assigning names or application values over time
tally Adding numeric values where periods overlap
Rules Composing custom definitions of when

All three APIs use rules to select the periods they cover.

Quando definitions are JSON-compatible data. Parsers validate stored data and restore the API methods.

import { parseSchedule } from "@kensio/quando";
const stored = JSON.stringify(openingHours);
const restored = parseSchedule(JSON.parse(stored));

The getting-started guide builds a complete schedule. Concepts explains the underlying model. The API reference lists the public exports.