Files
HealthLog/src/lib/doctor-report-range.ts
T
Marc-André Bombeck da3d29424d fix(visits): cap the window before a visit at the longest report
The window before a booked visit started at the last matching visit
however far back it lay, while the health-report export covers 730 days
and fell back to its 90-day default for anything longer. The card then
offered a report the export did not build. The window now stops at the
export's limit, read from one shared constant, and preparation.capped says
when it did; the web says "The last two years" for it.

The export clamps an over-long explicit range to the last 730 days before
its end instead of falling back to 90 days, so a custom range or a linked
window cannot shrink silently either, and its day count forgives the hour
a clock change adds, so two years of local days count as 730.
2026-11-05 14:12:09 +01:00

11 lines
440 B
TypeScript

/**
* The longest window a health report covers, in days, inclusive of both end
* days. The export clamps a longer range to the last this many days ending
* on its end (`normaliseDateRange`), and the window offered before a booked
* visit is capped at it (`resolvePreparation`), so the visit card never
* promises a report the export will not produce.
*
* Client-safe: no server import.
*/
export const REPORT_MAX_RANGE_DAYS = 730;