diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d50fa..0d9d790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ versions follow [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [2.26.1] - 2026-11-30 + +No migration; no API is removed. Contracts 1.24.0 (vendored). + +### Changed + +- **Devotionals up to two years ahead** (was 3 months; contracts + `CROSSCODE_DEVOTIONALS_SCHEDULE_MONTHS`): writing, editing and Import CSV take any day up to + two years from today, and the calendar shows them all. A CSV can hold two years in one file + (800 rows, 8 MB; was 400 and 2 MB). +- **`GET /api/v2/devotionals` answers 2 weeks** (`from` and the 13 days after it; contracts + `CROSSCODE_DEVOTIONALS_FETCH_DAYS`), not 3 months. An App fetches it every night. + ## [2.26.0] - 2026-11-30 The Church App (crosscode-platform docs/APP-1.0-PLAN.md §6, §12). One migration diff --git a/backend/package-lock.json b/backend/package-lock.json index 2635f1d..904093c 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,16 +1,16 @@ { "name": "events-hub-backend", - "version": "2.26.0", + "version": "2.26.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "events-hub-backend", - "version": "2.26.0", + "version": "2.26.1", "hasInstallScript": true, "dependencies": { "@anthropic-ai/sdk": "^1.3.0", - "@crosscode/contracts": "file:vendor/crosscode-contracts-1.23.0.tgz", + "@crosscode/contracts": "file:vendor/crosscode-contracts-1.24.0.tgz", "@prisma/adapter-pg": "^7.10.1", "@prisma/client": "^7.10.1", "bcryptjs": "^2.4.3", @@ -609,9 +609,9 @@ "license": "MIT" }, "node_modules/@crosscode/contracts": { - "version": "1.23.0", - "resolved": "file:vendor/crosscode-contracts-1.23.0.tgz", - "integrity": "sha512-2P86mOLRiPsfSFBxBdx65cATKqsUpZ/dcOWC6qIGJjLNq0h4RH1+nz3yYkbfMjl6HjdkBE6qc491cc5tLKIFZQ==", + "version": "1.24.0", + "resolved": "file:vendor/crosscode-contracts-1.24.0.tgz", + "integrity": "sha512-PmlpaFjnytV4WuxU4rvjAwuggLYQQKiCoH4K9tutk412uuDMlXNsqPsGe2eKSwp9eqOclMZzUkDw+ghnUYV7oQ==", "license": "UNLICENSED", "dependencies": { "zod": "^4.6.7" diff --git a/backend/package.json b/backend/package.json index c63bf34..8bf158e 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "events-hub-backend", - "version": "2.26.0", + "version": "2.26.1", "private": true, "description": "Cross Events Hub — API for managing Cross Events installs, licences and heartbeats", "main": "src/index.js", @@ -20,7 +20,7 @@ }, "dependencies": { "@anthropic-ai/sdk": "^1.3.0", - "@crosscode/contracts": "file:vendor/crosscode-contracts-1.23.0.tgz", + "@crosscode/contracts": "file:vendor/crosscode-contracts-1.24.0.tgz", "@prisma/adapter-pg": "^7.10.1", "@prisma/client": "^7.10.1", "bcryptjs": "^2.4.3", diff --git a/backend/src/app.js b/backend/src/app.js index 9491b47..b64d81c 100644 --- a/backend/src/app.js +++ b/backend/src/app.js @@ -8,9 +8,9 @@ app.disable('x-powered-by'); // Installs call the Hub server-to-server; only the dashboard needs CORS. app.use(cors({ origin: (process.env.FRONTEND_URL || 'http://localhost:3200').replace(/\/$/, '') })); -// 2.26.0: a devotionals CSV is up to 2 MB (contracts DEVOTIONAL_CSV_MAX_BYTES), sent as JSON text. +// 2.26.0: a devotionals CSV, sent as JSON text (2.26.1: up to 8 MB, contracts DEVOTIONAL_CSV_MAX_BYTES). // Parsed here first; the parser below skips a body already read. -app.use('/api/admin/devotionals/import', express.json({ limit: '4mb' })); +app.use('/api/admin/devotionals/import', express.json({ limit: '12mb' })); // Keep the exact bytes: heartbeat signatures are over the raw body. 300 KB fits the largest AI // request the Hub accepts (utils/ai.js MAX_INPUT_TOKENS). diff --git a/backend/src/routes/devotionals.js b/backend/src/routes/devotionals.js index 4c94527..8d8945b 100644 --- a/backend/src/routes/devotionals.js +++ b/backend/src/routes/devotionals.js @@ -1,6 +1,6 @@ /** - * Cross Code's devotionals (Hub 2.26.0, APP-1.0-PLAN §6): write and schedule them up to 3 months - * ahead, the calendar, Import CSV with its preview, and the template. Admin login required. + * Cross Code's devotionals (Hub 2.26.0, APP-1.0-PLAN §6): write and schedule them up to two years + * ahead (2.26.1; 3 months before), the calendar, Import CSV with its preview, and the template. Admin login required. */ const express = require('express'); @@ -30,7 +30,7 @@ router.get('/template.csv', (req, res) => { res.send(DEVOTIONAL_CSV_TEMPLATE); }); -// A CSV comes as text in JSON ({ csv }), up to 2 MB (app.js parses these two with a larger limit). +// A CSV comes as text in JSON ({ csv }), up to 8 MB (app.js parses these two with a larger limit). router.post('/import/preview', wrap(async (req, res) => { res.json(await devotionals.previewCsv(req.body?.csv)); })); diff --git a/backend/src/routes/installApi.js b/backend/src/routes/installApi.js index f0b4bff..fb6d353 100644 --- a/backend/src/routes/installApi.js +++ b/backend/src/routes/installApi.js @@ -409,7 +409,7 @@ router.post('/installs/update-request/cancel', updateRequestLimiter, async (req, // ─── Cross Code's devotionals (Hub 2.26.0, contracts hub.DEVOTIONALS_PATH) ───── /** - * GET /api/v2/devotionals?from=YYYY-MM-DD: the next 3 months of Cross Code's devotionals for an App + * GET /api/v2/devotionals?from=YYYY-MM-DD: the next 2 weeks of Cross Code's devotionals for an App * set to "From Cross Code" (once a night, and on "Sync now"). `Authorization: Bearer `: App licences only, active or in their grace days. */ diff --git a/backend/src/utils/devotionals.js b/backend/src/utils/devotionals.js index f9ebf29..351cb5b 100644 --- a/backend/src/utils/devotionals.js +++ b/backend/src/utils/devotionals.js @@ -1,15 +1,15 @@ /** * Cross Code's devotionals (Hub 2.26.0, crosscode-platform docs/APP-1.0-PLAN.md §6, decisions 1, 5 - * and 14; contracts crosscode.devotional/1). Written here, or imported from CSV, up to 3 months - * ahead, one per day, in the free translations only (KJV and BSB). An App set to "From Cross Code" - * fetches the next 3 months once a night (`GET /api/v2/devotionals`) and keeps its copy. + * and 14; contracts crosscode.devotional/1). Written here, or imported from CSV, up to two years + * ahead (2.26.1, contracts CROSSCODE_DEVOTIONALS_SCHEDULE_MONTHS; 3 months in 2.26.0), one per day, in the free translations only (KJV and BSB). An App set to "From Cross Code" + * fetches the next 2 weeks once a night (`GET /api/v2/devotionals`, 2.26.1; 3 months before) and keeps its copy. * * No AI touches a devotional's passage (Crossway and Biblica forbid it), and nothing here sends * one: the Apps show and send them. */ const { - BIBLE_TRANSLATIONS, FREE_BIBLE_TRANSLATION_IDS, DEVOTIONAL_CSV_TEMPLATE, DEVOTIONAL_CSV_COLUMNS, CROSSCODE_DEVOTIONALS_AHEAD_MONTHS, DEVOTIONAL_SCHEMA, PASSAGE_WARN_VERSES, + BIBLE_TRANSLATIONS, FREE_BIBLE_TRANSLATION_IDS, DEVOTIONAL_CSV_TEMPLATE, DEVOTIONAL_CSV_COLUMNS, CROSSCODE_DEVOTIONALS_FETCH_DAYS, CROSSCODE_DEVOTIONALS_SCHEDULE_MONTHS, DEVOTIONAL_SCHEMA, PASSAGE_WARN_VERSES, checkDevotionalCsv, devotionalContentSchema, devotionalsReplySchema, parseBibleReference, formatBibleReference, passageVerseCount, youVersionUrl, bibleTranslation, } = require('@crosscode/contracts'); @@ -30,8 +30,11 @@ function addMonths(date, months) { return new Date(Date.UTC(y, m - 1 + months, Math.min(d, last))).toISOString().slice(0, 10); } -/** The last day a devotional can be scheduled for: 3 months from today. */ -const latestDate = (now = new Date()) => addMonths(today(now), CROSSCODE_DEVOTIONALS_AHEAD_MONTHS); +/** The last day a devotional can be scheduled for: two years from today (2.26.1). */ +const latestDate = (now = new Date()) => addMonths(today(now), CROSSCODE_DEVOTIONALS_SCHEDULE_MONTHS); + +/** "two years", "3 months": how far ahead, in words. */ +const aheadWords = (m = CROSSCODE_DEVOTIONALS_SCHEDULE_MONTHS) => (m % 12 === 0 ? (m === 12 ? 'a year' : m === 24 ? 'two years' : `${m / 12} years`) : `${m} months`); /** The translations the Hub offers (the free ones), for the form. */ function translations() { @@ -49,7 +52,7 @@ function shape(row) { /** * The form's fields as devotional content: the passage parsed and written out in the - * translation's language, the free translations only, the date within 3 months. + * translation's language, the free translations only, the date within two years. * Returns { devotional, warnings }. */ function contentFrom(input, now = new Date()) { @@ -57,7 +60,7 @@ function contentFrom(input, now = new Date()) { const date = String(b.date || '').trim(); if (!DATE.test(date)) throw fail(400, 'BAD_REQUEST', 'Give the date as YYYY-MM-DD.'); const latest = latestDate(now); - if (date > latest) throw fail(400, 'TOO_FAR_AHEAD', `Devotionals are scheduled up to ${CROSSCODE_DEVOTIONALS_AHEAD_MONTHS} months ahead (the last day is ${latest}).`); + if (date > latest) throw fail(400, 'TOO_FAR_AHEAD', `Devotionals are scheduled up to ${aheadWords()} ahead (the last day is ${latest}).`); const translation = String(b.translation || '').trim().toUpperCase(); if (!FREE_BIBLE_TRANSLATION_IDS.includes(translation)) { const t = BIBLE_TRANSLATIONS.find(x => x.id === translation); @@ -109,7 +112,7 @@ async function overview(now = new Date()) { const filled = new Set(rows.map(r => r.date)); const empty = []; for (let d = from; d <= to; d = addDays(d, 1)) if (!filled.has(d)) empty.push(d); - return { today: from, latest: to, aheadMonths: CROSSCODE_DEVOTIONALS_AHEAD_MONTHS, devotionals: rows, empty, translations: translations(), + return { today: from, latest: to, aheadMonths: CROSSCODE_DEVOTIONALS_SCHEDULE_MONTHS, ahead: aheadWords(), appFetchDays: CROSSCODE_DEVOTIONALS_FETCH_DAYS, devotionals: rows, empty, translations: translations(), csv: { columns: DEVOTIONAL_CSV_COLUMNS, template: DEVOTIONAL_CSV_TEMPLATE } }; } @@ -136,7 +139,7 @@ async function create(input, admin, now = new Date()) { async function update(id, input, now = new Date()) { const existing = await prisma.devotional.findUnique({ where: { id } }); if (!existing) throw fail(404, 'NOT_FOUND', 'Devotional not found.'); - // An old one keeps its date even when that's now in the past; a new date must be within 3 months. + // An old one keeps its date even when that's now in the past; a new date must be within two years. const { devotional, warnings } = contentFrom(input, now); if (devotional.date !== existing.date) { const taken = await prisma.devotional.findUnique({ where: { date: devotional.date } }); @@ -187,11 +190,12 @@ async function importCsv(text, { replace = false } = {}, admin, now = new Date() /** * `GET /api/v2/devotionals?from=YYYY-MM-DD` (contracts hub.DEVOTIONALS_PATH): the devotionals - * from `from` (today by default) to 3 months on, for an App install. + * from `from` (today by default), for an App install: 2 weeks, `from` included (2.26.1, + * contracts CROSSCODE_DEVOTIONALS_FETCH_DAYS; 3 months before). */ async function reply(from, now = new Date()) { const start = from || today(now); - const to = addMonths(start, CROSSCODE_DEVOTIONALS_AHEAD_MONTHS); + const to = addDays(start, CROSSCODE_DEVOTIONALS_FETCH_DAYS - 1); const rows = (await list({ from: start, to })).slice(0, 100); return devotionalsReplySchema.parse({ schema: DEVOTIONAL_SCHEMA, from: start, to, @@ -203,4 +207,4 @@ async function reply(from, now = new Date()) { /** The YouVersion link for a devotional's passage (the page's "Read in YouVersion"). */ const youVersionLink = d => youVersionUrl(d.passage.location, d.passage.translation); -module.exports = { today, addMonths, latestDate, translations, contentFrom, list, overview, get, create, update, remove, previewCsv, importCsv, reply, youVersionLink, DATE }; +module.exports = { today, addMonths, addDays, latestDate, translations, contentFrom, list, overview, get, create, update, remove, previewCsv, importCsv, reply, youVersionLink, DATE }; diff --git a/backend/tests/devotionals.test.js b/backend/tests/devotionals.test.js index 7adabc0..c7a93d7 100644 --- a/backend/tests/devotionals.test.js +++ b/backend/tests/devotionals.test.js @@ -1,5 +1,5 @@ -// Hub 2.26.0 (crosscode-platform docs/APP-1.0-PLAN.md §6): Cross Code's devotionals. Written up to 3 -// months ahead in the free translations only, imported from CSV with a preview, and fetched by App +// Hub 2.26.0 (crosscode-platform docs/APP-1.0-PLAN.md §6): Cross Code's devotionals. Written up to two +// years ahead (2.26.1) in the free translations only, imported from CSV with a preview, and fetched by App // installs (GET /api/v2/devotionals with the licence token; App licences only). Also the App's // tier alert (its active-member band above its tier). const crypto = require('crypto'); @@ -29,20 +29,21 @@ const form = (over = {}) => ({ beforeEach(() => { for (const k of Object.keys(db.tables)) db.tables[k].length = 0; }); describe('writing devotionals', () => { - test('a devotional: the passage written out, in a free translation, within 3 months', async () => { + test('a devotional: the passage written out, in a free translation, within two years', async () => { const { devotional, warnings } = await devotionals.create(form(), admin, NOW); expect(devotional).toMatchObject({ date: '2026-12-05', passage: { reference: '1 Corinthians 13:4–7', translation: 'BSB', text: 'Love is patient, love is kind.' }, prayer: 'Lord, teach me to love.' }); expect(warnings).toEqual([]); await expect(devotionals.create(form({ title: 'Another' }), admin, NOW)).rejects.toMatchObject({ code: 'DATE_TAKEN' }); }); - test('refused: a translation that needs permission, more than 3 months ahead, a reference that can\'t be read, an empty field', async () => { - expect(devotionals.latestDate(NOW)).toBe('2027-02-28'); + test('refused: a translation that needs permission, more than two years ahead, a reference that can\'t be read, an empty field', async () => { + expect(devotionals.latestDate(NOW)).toBe('2028-11-30'); await expect(devotionals.create(form({ translation: 'NIV' }), admin, NOW)).rejects.toMatchObject({ code: 'TRANSLATION_NOT_FREE', message: expect.stringContaining('KJV or BSB') }); - await expect(devotionals.create(form({ date: '2027-03-01' }), admin, NOW)).rejects.toMatchObject({ code: 'TOO_FAR_AHEAD', message: expect.stringContaining('2027-02-28') }); + expect((await devotionals.create(form({ date: '2028-11-30', title: 'Two years on' }), admin, NOW)).devotional.date).toBe('2028-11-30'); + await expect(devotionals.create(form({ date: '2028-12-01' }), admin, NOW)).rejects.toMatchObject({ code: 'TOO_FAR_AHEAD', message: expect.stringContaining('up to two years ahead (the last day is 2028-11-30)') }); await expect(devotionals.create(form({ reference: 'Hezekiah 1:1' }), admin, NOW)).rejects.toMatchObject({ code: 'BAD_REFERENCE' }); await expect(devotionals.create(form({ body: ' ' }), admin, NOW)).rejects.toMatchObject({ status: 400, message: expect.stringContaining('The devotional') }); - expect(await db.devotional.findMany({})).toEqual([]); + expect((await db.devotional.findMany({})).map(d => d.date)).toEqual(['2028-11-30']); }); test('a long passage is saved, with a warning', async () => { @@ -56,7 +57,7 @@ describe('writing devotionals', () => { await expect(devotionals.update(devotional.id, form({ date: '2026-12-06' }), NOW)).rejects.toMatchObject({ code: 'DATE_TAKEN' }); expect((await devotionals.update(devotional.id, form({ date: '2026-12-07', title: 'Moved' }), NOW)).devotional).toMatchObject({ date: '2026-12-07', title: 'Moved' }); const o = await devotionals.overview(NOW); - expect(o).toMatchObject({ today: '2026-11-30', latest: '2027-02-28', aheadMonths: 3 }); + expect(o).toMatchObject({ today: '2026-11-30', latest: '2028-11-30', aheadMonths: 24, ahead: 'two years', appFetchDays: 14 }); expect(o.devotionals.map(d => d.date)).toEqual(['2026-12-06', '2026-12-07']); expect(o.empty).toContain('2026-12-05'); expect(o.empty).not.toContain('2026-12-06'); @@ -72,12 +73,12 @@ describe('Import CSV', () => { test('the preview checks every row: a translation needing permission, too far ahead, a day taken', async () => { await devotionals.create(form({ date: '2026-12-11' }), admin, NOW); - const csv = devotionalCsv([row(), row({ date: '2026-12-11' }), row({ date: '2026-12-12', translation: 'ESV' }), row({ date: '2027-06-01' })]); + const csv = devotionalCsv([row(), row({ date: '2026-12-11' }), row({ date: '2026-12-12', translation: 'ESV' }), row({ date: '2028-12-01' })]); const preview = await devotionals.previewCsv(csv, NOW); expect(preview.fileError).toBeNull(); expect(preview.rows.map(r => [!!r.devotional, r.taken])).toEqual([[true, false], [true, true], [false, false], [false, false]]); expect(preview.rows[2].errors[0].message).toContain('Crossway'); - expect(preview.rows[3].errors[0].message).toContain('3 months'); + expect(preview.rows[3].errors[0].message).toContain('too far ahead (the last day is 2028-11-30)'); }); test('importing saves the valid rows; days already filled are skipped or replaced', async () => { @@ -109,16 +110,18 @@ describe('GET /api/v2/devotionals', () => { } const get = (token, query = '') => fetch(`${base}/v2/devotionals${query}`, { headers: token ? { Authorization: `Bearer ${token}` } : {} }); - test("an App's licence token gets the next 3 months from `from`, as crosscode.devotional/1", async () => { + test("an App's licence token gets the next 2 weeks from `from`, as crosscode.devotional/1", async () => { const today = devotionals.today(); - const later = devotionals.addMonths(today, 1); + const later = devotionals.addDays(today, 13); + const tooLate = devotionals.addDays(today, 14); + await db.devotional.create({ data: { id: crypto.randomUUID(), date: tooLate, title: 'Too late', passage: { reference: 'John 3:16', location: { book: 'JHN', chapter: 3, verse: 16, endChapter: 3, endVerse: 16 }, translation: 'KJV', text: 'x' }, body: 'Body', prayer: null, author: null, updatedAt: new Date() } }); await db.devotional.create({ data: { id: crypto.randomUUID(), date: later, title: 'Later', passage: { reference: 'John 3:16', location: { book: 'JHN', chapter: 3, verse: 16, endChapter: 3, endVerse: 16 }, translation: 'KJV', text: 'For God so loved the world' }, body: 'Body', prayer: null, author: null, updatedAt: new Date() } }); await db.devotional.create({ data: { id: crypto.randomUUID(), date: '2020-01-01', title: 'Old', passage: { reference: 'John 3:16', location: { book: 'JHN', chapter: 3, verse: 16, endChapter: 3, endVerse: 16 }, translation: 'KJV', text: 'x' }, body: 'Body', prayer: null, author: null, updatedAt: new Date() } }); const res = await get(await licence()); expect(res.status).toBe(200); const body = await res.json(); expect(devotionalsReplySchema.safeParse(body).success).toBe(true); - expect(body).toMatchObject({ from: today, to: devotionals.addMonths(today, 3) }); + expect(body).toMatchObject({ from: today, to: later }); expect(body.devotionals.map(d => [d.date, d.source])).toEqual([[later, 'crosscode']]); }); diff --git a/backend/vendor/crosscode-contracts-1.23.0.tgz b/backend/vendor/crosscode-contracts-1.23.0.tgz deleted file mode 100644 index 91744ea..0000000 Binary files a/backend/vendor/crosscode-contracts-1.23.0.tgz and /dev/null differ diff --git a/backend/vendor/crosscode-contracts-1.24.0.tgz b/backend/vendor/crosscode-contracts-1.24.0.tgz new file mode 100644 index 0000000..369c57d Binary files /dev/null and b/backend/vendor/crosscode-contracts-1.24.0.tgz differ diff --git a/docs/hub-protocol.md b/docs/hub-protocol.md index 96ce94f..9b6d2ac 100644 --- a/docs/hub-protocol.md +++ b/docs/hub-protocol.md @@ -264,9 +264,10 @@ X-Hub-Install / X-Hub-Timestamp / X-Hub-Signature (as in §3) `GET /api/v2/devotionals?from=YYYY-MM-DD` (contracts `hub.DEVOTIONALS_PATH`), with `Authorization: Bearer ` (§4); no signature. An App set to "From Cross Code" calls it once a night (and on "Sync now") and keeps what it gets, so a Hub outage -changes nothing. +of less than 2 weeks changes nothing. -- `from` defaults to today (South Africa); the answer covers `from` to 3 months on, one +- `from` defaults to today (South Africa); the answer covers `from` and the 13 days after it + (2 weeks, contracts `CROSSCODE_DEVOTIONALS_FETCH_DAYS`; Hub 2.26.0 answered 3 months), one devotional per day at most, oldest first (`devotionalsReplySchema`, `crosscode.devotional/1`, each with `source: "crosscode"`). The App replaces its copy of that range: a day missing from the list was removed in the Hub. diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7f129ce..628c7e0 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "events-hub-frontend", - "version": "2.26.0", + "version": "2.26.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "events-hub-frontend", - "version": "2.26.0", + "version": "2.26.1", "dependencies": { "lucide-react": "^0.536.0", "next": "^15.5.24", diff --git a/frontend/package.json b/frontend/package.json index 4f827bf..dda4af2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "events-hub-frontend", - "version": "2.26.0", + "version": "2.26.1", "private": true, "scripts": { "dev": "next dev -p 3200", diff --git a/frontend/src/app/(hub)/devotionals/page.tsx b/frontend/src/app/(hub)/devotionals/page.tsx index 6cdb925..b142029 100644 --- a/frontend/src/app/(hub)/devotionals/page.tsx +++ b/frontend/src/app/(hub)/devotionals/page.tsx @@ -10,7 +10,7 @@ type Translation = { id: string; name: string; language: string; copyright: stri type Passage = { reference: string; translation: string; text: string; location: unknown }; type Devotional = { id: string; date: string; title: string; passage: Passage; body: string; prayer: string | null; author: string | null; updatedAt: string }; type Overview = { - today: string; latest: string; aheadMonths: number; devotionals: Devotional[]; empty: string[]; + today: string; latest: string; aheadMonths: number; ahead: string; appFetchDays: number; devotionals: Devotional[]; empty: string[]; translations: Translation[]; csv: { columns: string[]; template: string }; }; type CsvIssue = { column: string | null; message: string }; @@ -39,7 +39,7 @@ function months(from: string, to: string) { return out; } -/** The days from today to 3 months ahead: filled ones open their devotional, empty ones a new one. */ +/** The days from today to two years ahead (2.26.1): filled ones open their devotional, empty ones a new one. */ function Calendar({ o, onOpen }: { o: Overview; onOpen: (date: string, d: Devotional | null) => void }) { const byDate = useMemo(() => new Map(o.devotionals.map(d => [d.date, d])), [o]); return ( @@ -53,7 +53,7 @@ function Calendar({ o, onOpen }: { o: Overview; onOpen: (date: string, d: Devoti if (!day) return ; const inRange = day >= o.today && day <= o.latest; const d = byDate.get(day) || null; - const label = `${longDate(day)}: ${d ? d.title : inRange ? "no devotional yet" : "outside the 3 months"}`; + const label = `${longDate(day)}: ${d ? d.title : inRange ? "no devotional yet" : "outside the dates allowed"}`; return ( @@ -238,7 +238,7 @@ export default function DevotionalsPage() { setPopup({ kind: "edit", date: o.empty[0], d: null }) : undefined} /> { const gap = o.empty[0]; const until = o.devotionals.filter(d => !gap || d.date < gap).at(-1); return until ? longDate(until.date) : "Not today yet"; })()} /> - + setPopup({ kind: "edit", date, d })} />