Files
CrazeAnalytix/services
Christian Vidal WolfandQwen-Coder d5936f1301 fix(experimentAnalysis): use ISO calendar weeks for treatment/baseline periods
- Add ISO week calculation functions (getISOWeek, getISOWeekMonday, calculateISOWeekRange)
- Expand experiment dates to full ISO weeks (Monday-Sunday) instead of exact date ranges
- Use actual data.length for averaging metrics instead of theoretical durationWeeks
- Baseline now takes same number of complete weeks immediately before experiment

Fixes incorrect units sold average calculation (was 6.5, now correctly shows 4.33 for 13 units over 3 weeks)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 15:00:24 +01:00
..