calendary
constcalendary:CalendaryFn
Factory function with generics support
Template
Section titled “Template”TMetadata
Custom metadata type for events
Template
Section titled “Template”TCategory
Category type for events
Example
Section titled “Example”// Default usageconst cal = calendary();
// With typed metadatainterface LiturgicalMetadata { rank: string; vestmentColor: string; }const cal = calendary<LiturgicalMetadata>();const day = cal.getDay("2025-12-25");day.events[0].metadata?.rank; // TypeScript knows this exists
// With typed metadata and categoriestype LiturgicalCategory = "solemnity" | "feast" | "memorial";const cal = calendary<LiturgicalMetadata, LiturgicalCategory>();