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 yearly timebucket

Blue Mouse437bdee5b2fa
diff --git a/apps/production/src/analytics/analytics.service.ts b/apps/production/src/analytics/analytics.service.ts
index 310ca6bcd..d6802b529 100644
--- a/apps/production/src/analytics/analytics.service.ts
+++ b/apps/production/src/analytics/analytics.service.ts
@@ -1087,7 +1087,15 @@ export class AnalyticsService {
generateDateString(row: { [key: string]: number }): string {
const { year, month, day, hour, minute } = row
- let dateString = `${year}-${month < 10 ? `0${month}` : month}`
+ let dateString = `${year}`
+
+ if (typeof month === 'number') {
+ if (month < 10) {
+ dateString += `-0${month}`
+ } else {
+ dateString += `-${month}`
+ }
+ }
if (typeof day === 'number') {
if (day < 10) {