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:
1 parent
69c94d83d7
commit
f119a0cacc
2 files changed
+34
-1
No files matched your search
@@ -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.`)
|
||||
|
||||
Reference in new issue
Block a user