Skip to content

Fix schedule yesterday-branch endTime typo (closes #1190)#1191

Open
pawmmm wants to merge 1 commit into
tagyoureit:masterfrom
pawmmm:fix/master/schedule-yesterday-endtime-typo
Open

Fix schedule yesterday-branch endTime typo (closes #1190)#1191
pawmmm wants to merge 1 commit into
tagyoureit:masterfrom
pawmmm:fix/master/schedule-yesterday-endtime-typo

Conversation

@pawmmm
Copy link
Copy Markdown

@pawmmm pawmmm commented May 22, 2026

Summary

  • Fix controller/State.ts:1312 — the "still running from yesterday" branch of ScheduleTime.calcScheduleDate was assigning times.endTime = ytimes.startTime instead of ytimes.endTime.

That single typo collapsed the synthesized live window to a zero-duration point in the past, which made _calcShouldBeOn return false whenever a schedule's window crossed local midnight and the current time was before today's ttimes.startTime.

The today-branch (line 1301: times.endTime = ttimes.endTime) and tomorrow-branch (line 1331: times.endTime = ntimes.endTime) were already correct; only the yesterday-branch was wrong. The fix copies that pattern.

Reference issue

Closes #1190 — full trace is in the issue. Short version: a 12:00 PM → 12:00 PM schedule shows greyed/inactive in dashPanel from midnight until noon on the following day, because every AM evaluation lands in the yesterday-branch and gets the broken endTime back.

Test plan

  • tsc --noEmit passes (baseline was clean, diff still clean).
  • Manual: configure a single schedule 12:00 PM → 12:00 PM on a feature, wait through midnight, confirm dashPanel shows it active in the AM hours of the following day.
  • Manual: configure two overlapping schedules (e.g. 12:00 AM → 12:00 AM and 12:00 PM → 12:00 PM) on the same circuit and confirm both show active in their respective windows after a midnight rollover.

Risk

Localized to a single line in a branch that was already returning a degenerate window. No callers depend on the old (broken) value.

In ScheduleTime.calcScheduleDate, the "still running from yesterday"
branch assigned times.endTime = ytimes.startTime instead of
ytimes.endTime. The resulting zero-duration window in the past made
_calcShouldBeOn return false for any schedule whose current run window
crossed local midnight, until tm finally entered today's ttimes.

The today-branch (line 1301) and tomorrow-branch (line 1331) already
use *.endTime correctly; only the yesterday-branch was wrong.

Fixes tagyoureit#1190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schedule that crosses midnight shows shouldBeOn=false during AM hours (typo: ytimes.endTime mis-assigned to ytimes.startTime)

1 participant