From 6d5af68960583e31652a066adb1ca3484c1fd883 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Tue, 24 Apr 2018 15:50:25 +0200 Subject: [PATCH] Allow more fine-grained filtering on date --- app/controllers/statistics_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/statistics_controller.rb b/app/controllers/statistics_controller.rb index 0c60b697..8640a9cd 100644 --- a/app/controllers/statistics_controller.rb +++ b/app/controllers/statistics_controller.rb @@ -38,8 +38,8 @@ class StatisticsController < ApplicationController format.html { render 'rfc_activity_history' } format.json do interval = params[:interval] || 'year' - from = DateTime.strptime(params[:from], '%Y') rescue DateTime.new(0) - to = DateTime.strptime(params[:to], '%Y') rescue DateTime.now + from = DateTime.strptime(params[:from], '%Y-%M-%D') rescue DateTime.new(0) + to = DateTime.strptime(params[:to], '%Y-%M-%D') rescue DateTime.now render(json: ranged_rfc_data(interval, from, to)) end end