mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:55:23 +02:00
fix(experimentAnalysis): use ISO week start (Monday) consistently in aggregateWeeklyMetrics
- Change getWeekStartSunday to getISOWeekMonday for timestamp calculation - Ensures week alignment between data aggregation and ISO week range calculation - Fixes incorrect treatment_after average calculation Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
co-authored by
Qwen-Coder
parent
d5936f1301
commit
918da227ee
@@ -148,9 +148,10 @@ function aggregateWeeklyMetrics(
|
||||
const key = `${year}-W${String(weekNum).padStart(2, '0')}`;
|
||||
|
||||
if (!weeklyMap.has(key)) {
|
||||
// Use ISO week start (Monday) instead of Sunday for consistency
|
||||
weeklyMap.set(key, {
|
||||
week: key,
|
||||
timestamp: getWeekStartSunday(year, weekNum),
|
||||
timestamp: getISOWeekMonday(year, weekNum),
|
||||
units: 0,
|
||||
revenue: 0,
|
||||
adRevenue: 0,
|
||||
|
||||
Reference in New Issue
Block a user