mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
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.
11 lines
440 B
TypeScript
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;
|