fix: start od week

This commit is contained in:
Shivam Mishra
2026-03-09 12:50:29 +05:30
parent 0bc80bf95f
commit 8324d84fbf
4 changed files with 82 additions and 3 deletions
@@ -88,7 +88,7 @@ class V2::Reports::Timeseries::AverageReportBuilder < V2::Reports::Timeseries::B
def date_key_for_group(date)
case group_by
when 'week' then date.beginning_of_week(:monday)
when 'week' then date.beginning_of_week(:sunday)
when 'month' then date.beginning_of_month
when 'year' then date.beginning_of_year
else date
@@ -81,7 +81,7 @@ class V2::Reports::Timeseries::CountReportBuilder < V2::Reports::Timeseries::Bas
def date_key_for_period(date)
case group_by
when 'week' then date.beginning_of_week(:monday)
when 'week' then date.beginning_of_week(:sunday)
when 'month' then date.beginning_of_month
when 'year' then date.beginning_of_year
else date