mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
chore(charts): correct the sleep series clamp comment
The comment said the series route caps sleep at 365 days; the route accepts up to 3650, which is what the "All" tab asks for and what the clamp below applies.
This commit is contained in:
1 parent
2284040c6e
commit
3b3adc3aed
1 file changed
+2
-2
@@ -73,8 +73,8 @@ async function readDailySeries({
|
||||
async function fetchSleepNights() {
|
||||
const sleepParams = new URLSearchParams();
|
||||
sleepParams.set("kind", "sleep");
|
||||
// The series route caps sleep at 365 days; clamp the request so a
|
||||
// longer comparison window still resolves.
|
||||
// The series route caps `days` at 3650 (the "All" tab); clamp the
|
||||
// request so a window stretched by a comparison shift still resolves.
|
||||
sleepParams.set(
|
||||
"days",
|
||||
String(Math.max(1, Math.min(3650, Math.ceil(fetchWindow.windowDays)))),
|
||||
|
||||
Reference in new issue
Block a user