From 59e540995b2a5a0bbfebe91b823dd14d3f3989c6 Mon Sep 17 00:00:00 2001 From: tetebueno <9064236+tetebueno@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:54:44 -0300 Subject: [PATCH 1/2] Default to today on map view. --- app/controllers/map_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/map_controller.rb b/app/controllers/map_controller.rb index be255f08..a792a4ab 100644 --- a/app/controllers/map_controller.rb +++ b/app/controllers/map_controller.rb @@ -20,7 +20,7 @@ class MapController < ApplicationController private def start_at - return 1.month.ago.beginning_of_day.to_i if params[:start_at].nil? + return Time.zone.today.beginning_of_day.to_i if params[:start_at].nil? Time.zone.parse(params[:start_at]).to_i end From d44dbc8e9e2123665e7406a0d839b2eff6328aa8 Mon Sep 17 00:00:00 2001 From: tetebueno <9064236+tetebueno@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:37:40 -0300 Subject: [PATCH 2/2] Adapt view buttons to new default. --- app/views/map/index.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/map/index.html.erb b/app/views/map/index.html.erb index 9c93f417..b8f6645f 100644 --- a/app/views/map/index.html.erb +++ b/app/views/map/index.html.erb @@ -21,11 +21,6 @@ <%= f.submit "Search", class: "px-4 py-2 bg-blue-500 text-white rounded-md" %> -