CalendarDay
Base calendar day - the fundamental unit returned by getDays()
This is the core day structure that plugins can extend via DayEnricher. Contains only universal calendar properties. Clients should handle formatting themselves.
Example
Section titled “Example”// Default usageconst day: CalendarDay = cal.getDay("2025-12-25");
// With typed metadatainterface LiturgicalMetadata { rank: string; }const day: CalendarDay<LiturgicalMetadata> = cal.getDay("2025-12-25");day.events[0].metadata?.rank; // TypeScript knows this existsExtends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”TMetadata
Section titled “TMetadata”TMetadata extends Record<string, unknown> = Record<string, unknown>
Custom metadata type for events
TCategory
Section titled “TCategory”TCategory extends string = string
Category type for events
Properties
Section titled “Properties”date:
string
Date in YYYY-MM-DD format (derived from year/month/day, for convenience)
day:
number
Day of month (1-31)
Inherited from
Section titled “Inherited from”dayOfWeek
Section titled “dayOfWeek”dayOfWeek:
number
Day of week (0=Sunday, 1=Monday, …, 6=Saturday)
events
Section titled “events”events:
CalendarEvent<TMetadata,TCategory>[]
Events on this day, sorted by priority (highest first; can be empty)
isSunday
Section titled “isSunday”isSunday:
boolean
Whether this is a Sunday
isWeekday
Section titled “isWeekday”isWeekday:
boolean
Whether this is a weekday (Monday-Saturday)
month:
number
Month (1-12)
Inherited from
Section titled “Inherited from”year:
number
Calendar year