Implement basic diagram

This commit is contained in:
Maximilian Grundke
2018-04-24 15:44:10 +02:00
parent 64555d55fc
commit 321a602b57
4 changed files with 91 additions and 14 deletions

View File

@ -37,10 +37,10 @@ class StatisticsController < ApplicationController
respond_to do |format|
format.html { render 'rfc_activity_history' }
format.json do
range = params[:range] || 'year'
interval = params[:interval] || 'year'
from = DateTime.strptime(params[:from], '%Y') rescue DateTime.new(0)
to = DateTime.strptime(params[:to], '%Y') rescue DateTime.now
render(json: ranged_rfc_data(range, from, to))
render(json: ranged_rfc_data(interval, from, to))
end
end
end