Files
2026-05-27 23:29:53 +01:00

2.4 KiB

name: datetime description: Use when implementing or debugging code that uses @suaveplan/datetime: Timezone-aware date/time utilities with business-day arithmetic, recurrence rules, calendar math, and relative time formatting.

@suaveplan/datetime

Timezone-aware date/time utilities covering the most common application-layer date operations that the native Date API leaves unaddressed. The package provides calendar math (addDuration, subtractDuration, startOf, endOf, getCalendarMonth, leap-year detection), business-day arithmetic with configurable holiday calendars and custom weekend definitions, an RRULE-subset recurrence engine (DAILY/WEEKLY/MONTHLY/YEARLY with BYDAY/BYMONTH/COUNT/UNTIL), and human-readable relative time formatting ("3 hours ago", "in 2 days"). All stateful entry points accept an injectable Clock for deterministic testing. Use this package for scheduling UIs, calendar components, invoice date calculations, and any domain where "next business day" or "every other Monday" has real meaning. For low-level stopwatches, throttle/debounce, or vector clocks use @suaveplan/timing.

When to use this skill

  • Implementing or debugging code that imports @suaveplan/datetime.
  • The task touches: see package README.
  • You need API guidance for this package's exports.

Quick reference

import { /* see API Reference below */ } from "@suaveplan/datetime";

Dependencies

Workspace dependencies: @suaveplan/error, @suaveplan/types

Where to read more

This skill is intentionally short. The package's own documentation is the authoritative source — read these in order:

  1. packages/foundation/datetime/README.md — overview, install, quick-start, module index
  2. packages/foundation/datetime/src/**/*.md — co-located docs per implementation file (Purpose, Features, Basic + Advanced examples, full API reference, Implementation notes — all packages ship ≥200 words per module)
  3. packages/foundation/datetime/package.json exports map — every subpath you can import from

When the user asks an API question, read the relevant co-located .md first; do not answer from training-data memory.

See also

  • @suaveplan/error
  • @suaveplan/types

This SKILL.md is auto-generated by suaveplan-skills/scripts/generate-skills.ts from the package's README. Do not edit by hand — re-run the generator after the README changes.