mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
refactor(medications): hold recurrence.ts at its size baseline
This commit is contained in:
1 parent
270c6ca619
commit
cf7905dc92
1 file changed
+2
-5
@@ -788,14 +788,11 @@ function expandRrule(
|
||||
// to end — the anchor's day is read from its UTC fields and only then is
|
||||
// the HH:mm materialised in the user's zone. Reading the anchor in the
|
||||
// user's zone instead turned Monday 00:00Z into Sunday evening west of UTC.
|
||||
// Walk a generously padded day-anchor window so a per-day timesOfDay
|
||||
// expansion still hits the requested [from, to] after the time-of-day
|
||||
// is applied: a calendar day spans instants up to 14 h either side of
|
||||
// its UTC midnight, so widen the window by 2 days on each side.
|
||||
// Pad the day-anchor window by 2 days each side: a calendar day spans
|
||||
// instants up to 14 h either side of its UTC midnight.
|
||||
const padded = 2 * DAY_MS;
|
||||
const after = new Date(from.getTime() - padded);
|
||||
const before = new Date(to.getTime() + padded);
|
||||
|
||||
const start = alignedRruleStart(rruleStr, anchorCivilDay(ctx), after);
|
||||
const dtstartLine = `DTSTART:${formatUtcBasic(start)}`;
|
||||
// Skip the engine-side UNTIL suffix when the user's RRULE already
|
||||
|
||||
Reference in new issue
Block a user