Skip to content

Examples

Self-contained, copy-paste recipes — each one runs against the published npm package, nothing to clone. Install once:

Terminal window
npm i calendaryjs
# plus any plugins a recipe uses, e.g. npm i calendaryjs-plugin-lunar

Then drop a snippet into a .ts/.js file and run it. Ordered simplest → most involved:

Recipe Shows
A first calendar Create, add events, query a day/range
Recurring events Weekly / monthly / yearly / nth-weekday, count, interval, bounds
Anniversaries & milestones keepOrdinals, onMissingDay, ordinal
Collections & precedence Compose several, group priority, provenance, toggling

For the full reference behind these, see Building events, Event types, and Collections & groups.