From 644b7f489d45d5c0f1a5450197d8867c9fe4fad2 Mon Sep 17 00:00:00 2001 From: Guillaume Boudreau Date: Sun, 22 Sep 2024 07:32:33 -0400 Subject: [PATCH] Bugfix: when calculating the timestamp (for months and years), ignore the Timezone Fixes GH-194 --- app/helpers/application_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f1e17938..2f5250c0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,14 +11,14 @@ module ApplicationHelper end def year_timespan(year) - start_at = Time.utc(year).in_time_zone(Time.zone).beginning_of_year.strftime('%Y-%m-%dT%H:%M') - end_at = Time.utc(year).in_time_zone(Time.zone).end_of_year.strftime('%Y-%m-%dT%H:%M') + start_at = Time.new(year).beginning_of_year.strftime('%Y-%m-%dT%H:%M') + end_at = Time.new(year).end_of_year.strftime('%Y-%m-%dT%H:%M') { start_at:, end_at: } end def timespan(month, year) - month = DateTime.new(year, month).in_time_zone(Time.zone) + month = DateTime.new(year, month) start_at = month.beginning_of_month.to_time.strftime('%Y-%m-%dT%H:%M') end_at = month.end_of_month.to_time.strftime('%Y-%m-%dT%H:%M')