Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed the week iterator

Blue Mouse31f81ec16046
diff --git a/src/analytics/analytics.service.ts b/src/analytics/analytics.service.ts
index 0ee36b74e..97df94b07 100644
--- a/src/analytics/analytics.service.ts
+++ b/src/analytics/analytics.service.ts
@@ -846,11 +846,15 @@ export class AnalyticsService {
break
case TimeBucketType.DAY:
- case TimeBucketType.WEEK:
groupDateIterator = dayjs.utc(from).startOf('day')
format = 'YYYY-MM-DD'
break
+ case TimeBucketType.WEEK:
+ groupDateIterator = dayjs.utc(from).startOf('week')
+ format = 'YYYY-MM-DD'
+ break
+
case TimeBucketType.MONTH:
groupDateIterator = dayjs.utc(from).startOf('month')
format = 'YYYY-MM'
@@ -931,12 +935,6 @@ export class AnalyticsService {
}
}
- // length of sdur is sometimes lower than uniques, let's fix it by adding zeros
- // not sure if the bug is still here but leaving it here just in case
- // while (_size(sdur) < _size(uniques)) {
- // sdur.push(0)
- // }
-
return {
visits,
uniques,