Skip to content

Commit

Permalink
Fix DABBLE-ME-5Y
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed May 27, 2024
1 parent 581b1eb commit 9191c35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ def index

respond_to do |format|
format.json {
start_date = params[:start].presence || 1.years.ago.strftime("%Y-%m-%d")
end_date = params[:end].presence || Date.today.strftime("%Y-%m-%d")
render json: calendar_json(current_user.entries
.where("date >= '#{params[:start]}'::DATE AND date < '#{params[:end]}'::DATE")) }
.where("date >= '#{start_date}'::DATE AND date < '#{end_date}'::DATE")) }
format.html
end
end
Expand Down

0 comments on commit 9191c35

Please sign in to comment.