From 766e9db75201f24353fe65e6cc50465828f23f83 Mon Sep 17 00:00:00 2001 From: maatinito <15379878+maatinito@users.noreply.github.com> Date: Wed, 6 Mar 2019 13:55:40 -1000 Subject: [PATCH] converting DateTime to Date looses time zone information resulting in bad time computing Specifically, for Tahiti, time zone is -10 so after 14h, UTC time is Tahiti time + 10h i.e the day after. Loosing time zone results in 1 day difference whether the time is computed before of after 14h :-) --- app/controllers/stats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 5a7579fa7..c8cb4138a 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -204,7 +204,7 @@ class StatsController < ApplicationController def max_date if administration_signed_in? - Time.zone.now.to_date + Time.zone.now else Time.zone.now.beginning_of_month - 1.second end