Allow more fine-grained filtering on date
This commit is contained in:
@ -38,8 +38,8 @@ class StatisticsController < ApplicationController
|
|||||||
format.html { render 'rfc_activity_history' }
|
format.html { render 'rfc_activity_history' }
|
||||||
format.json do
|
format.json do
|
||||||
interval = params[:interval] || 'year'
|
interval = params[:interval] || 'year'
|
||||||
from = DateTime.strptime(params[:from], '%Y') rescue DateTime.new(0)
|
from = DateTime.strptime(params[:from], '%Y-%M-%D') rescue DateTime.new(0)
|
||||||
to = DateTime.strptime(params[:to], '%Y') rescue DateTime.now
|
to = DateTime.strptime(params[:to], '%Y-%M-%D') rescue DateTime.now
|
||||||
render(json: ranged_rfc_data(interval, from, to))
|
render(json: ranged_rfc_data(interval, from, to))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user