Analyse: Wochentag-Hinweis zählt den heutigen, unvollständigen Tag nicht mit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-04 21:34:43 +00:00
1 parent 69c94d83d7
commit f119a0cacc
2 files changed
+34 -1

No files matched your search

+8 -1
View File
@@ -298,9 +298,16 @@ function contactItem(stats, cmp) {
return text
}
// Der letzte Tag der Reihe ist heute und noch nicht zu Ende: er zaehlt beim Wochentag-Hinweis nicht mit
function completedDays(stats) {
const series = Array.isArray(stats.series) ? stats.series : []
const last = series[series.length - 1]
return last && (!stats.to || last.day === stats.to) ? series.slice(0, -1) : series
}
function dayItem(stats) {
if (!(Number(stats.totals.pv) >= 70)) return null
const w = weekdayStats(stats.series, stats.firstDay || '')
const w = weekdayStats(completedDays(stats), stats.firstDay || '')
if (!w) return null
const parts = []
if (w.best) parts.push(`${w.best.name} ist im Schnitt dein stärkster Tag.`)