Carry over unreached Advent bible-plan readings into Christmastide
Deploy / deploy (push) Successful in 1m55s
Deploy / deploy (push) Successful in 1m55s
Advent's own reading plan (advent-1-sunday through advent-4-saturday, 28 rows for a full 4-week Advent) is always longer than real Advent runs. Advent's last real day is always Dec 23 (Dec 24 is the Vigil of Christmas's own temporal id), while Advent 1 Sunday lands anywhere from Nov 27 to Dec 3 -- even the longest possible Advent is one row short of the full plan, and the shortest is a whole week short. Every year, at least the plan's last row never reaches its own natural date. Added adventCarryoverReadings to propers/bible-plan.ts: whatever doesn't land on its own natural date now carries forward one reading per day starting Christmas Day, pooled alongside whatever Christmastide's own calendar-dated rows already have -- never replacing them. This is the one place in bible-plan.ts that needs real calendar-year awareness (calendar/temporal.ts's adventStart). 4 new tests covering the shortest (2028) and a long (2027) Advent, pooling behavior, and the Dec-24 boundary. npm test (2029 passed) and tsc --noEmit pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AGjUyhUZJaSjiniEmnLdak
This commit is contained in:
@@ -38,3 +38,40 @@ describe('getBiblePlanReadings label uses the same book-alias normalization as v
|
||||
expect(readings[0]?.label?.la).toBe('Léctio libri Judith');
|
||||
});
|
||||
});
|
||||
|
||||
// The Advent reading plan has 28 rows (advent-1-sunday through
|
||||
// advent-4-saturday, a full 4-week Advent), but real Advent is never that
|
||||
// long -- its last real day is always Dec 23 (Dec 24 is the Vigil of
|
||||
// Christmas's own temporal id), while Advent 1 Sunday itself lands anywhere
|
||||
// from Nov 27 to Dec 3. Even the longest possible Advent (Nov 27) is 27
|
||||
// real days, one short of the full plan; the shortest (Dec 3) is 21, a
|
||||
// whole week short. Whatever doesn't land on its own natural date carries
|
||||
// forward one reading per day starting Christmas Day, pooled alongside
|
||||
// whatever Christmastide's own calendar-dated rows already have. User
|
||||
// direction, 2026-09-05: "for advent only, we need to show all of those
|
||||
// chapters," accepting the spillover into Christmastide as the trade-off.
|
||||
describe('Advent reading-plan carryover into Christmastide', () => {
|
||||
it('a short Advent (2028: Advent 1 Sunday = Dec 3, latest possible) carries all 7 of week 4\'s readings forward, one per day', () => {
|
||||
const isaiahCitations = [25, 26, 27, 28, 29, 30, 31].map(
|
||||
(day) => getBiblePlanReadings('christmas-octave-sunday', 'monday', `2028-12-${day}`).find((r) => r.citation.la?.startsWith('Isa'))?.citation.la,
|
||||
);
|
||||
expect(isaiahCitations).toEqual(['Isa 46-48', 'Isa 49-51', 'Isa 52-54', 'Isa 55-57', 'Isa 58-60', 'Isa 61-63', 'Isa 64-66']);
|
||||
});
|
||||
|
||||
it('a long Advent (2027: Advent 1 Sunday = Nov 28, near-earliest) carries only the last 2 readings forward', () => {
|
||||
const isaiahCitations = [25, 26, 27, 28].map(
|
||||
(day) => getBiblePlanReadings('christmas-octave-sunday', 'monday', `2027-12-${day}`).find((r) => r.citation.la?.startsWith('Isa'))?.citation.la,
|
||||
);
|
||||
expect(isaiahCitations).toEqual(['Isa 61-63', 'Isa 64-66', undefined, undefined]);
|
||||
});
|
||||
|
||||
it('carried-over readings pool alongside Christmastide\'s own calendar-dated rows, never replacing them', () => {
|
||||
const readings = getBiblePlanReadings('christmas-octave-sunday', 'friday', '2028-12-25');
|
||||
expect(readings.map((r) => r.citation.la)).toEqual(['Cant 1', 'Isa 46-48']);
|
||||
});
|
||||
|
||||
it('does not carry anything over before Christmas Day', () => {
|
||||
const readings = getBiblePlanReadings('vigil-of-christmas', 'thursday', '2028-12-24');
|
||||
expect(readings.find((r) => r.citation.la?.startsWith('Isa'))).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user