67037469fc
resolveDay() no longer hardcodes season: 'trinitytide'. Easter is computed via the Anonymous Gregorian algorithm (verified against 16 known reference dates spanning 1583-2100); Advent/Christmastide/ Epiphanytide follow the Christmas-anchored rules (including Advent's "Sunday nearest Nov 30"); Septuagesima through Trinitytide come from easter-offsets.yml, reshaped from single named anchor points into real ranges plus single-day overrides for Corpus Christi and Sacred Heart. occurring feasts (calendar/feasts.ts) are still a stub — the sanctoral calendar and Double-vs-not ranking are a separate, larger project.
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import type { LiturgicalDay } from './types';
|
|
import { weekdayOf } from './weekday';
|
|
import { resolveSeason } from './temporal';
|
|
|
|
/**
|
|
* Resolves everything about a given day *except* hour content — weekday,
|
|
* season, and any occurring feasts. Season is real (see
|
|
* calendar/temporal.ts); occurring feasts are still a stub until
|
|
* calendar/feasts.ts lands (the sanctoral calendar — which saint, if any,
|
|
* is kept on a given day, and Double-vs-not ranking — is a separate,
|
|
* larger project from temporal-cycle season resolution).
|
|
*/
|
|
export function resolveDay(isoDate: string): LiturgicalDay {
|
|
return {
|
|
date: isoDate,
|
|
weekday: weekdayOf(isoDate),
|
|
season: resolveSeason(isoDate),
|
|
occurring: [],
|
|
};
|
|
}
|
|
|
|
/**
|
|
* The Sunday/feast-vs-ferial split that several hours' propers key off of
|
|
* (Prime's capitulum and Preces, so far): a plain weekday with nothing else
|
|
* going on gets the "ferial" form, Sunday or an occurring feast gets the
|
|
* fuller "Sunday/feast" form. `occurring` is always [] until milestone 4, so
|
|
* today this reduces to "is it Sunday" — but the feast-override branch is
|
|
* real, not a stub, and will start firing the moment feasts do.
|
|
*/
|
|
export function isSundayOrFeast(day: LiturgicalDay): boolean {
|
|
return day.weekday === 'sunday' || day.occurring.length > 0;
|
|
}
|
|
|
|
export type { LiturgicalDay, OccurringFeast, Season, Weekday, FeastRank } from './types';
|