fix api/users/:login/headmaps.json bug
This commit is contained in:
parent
e440ee8483
commit
54b7f2c726
|
@ -10,15 +10,15 @@ class Users::HeadmapsController < Users::BaseController
|
||||||
private
|
private
|
||||||
def start_stamp
|
def start_stamp
|
||||||
if params[:year].present?
|
if params[:year].present?
|
||||||
Date.new(params[:year], 1).to_time.to_i
|
Date.new(params[:year].to_i, 1).to_time.to_i
|
||||||
else
|
else
|
||||||
Date.today.to_time.to_i - 365*24*60*60
|
(Date.today - 1.years).to_time.to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def end_stamp
|
def end_stamp
|
||||||
if params[:year].present?
|
if params[:year].present?
|
||||||
Date.new(params[:year], 1).to_time.to_i + 365*24*60*60
|
(Date.new(params[:year].to_i, 1) + 1.years).to_time.to_i
|
||||||
else
|
else
|
||||||
Date.today.to_time.to_i
|
Date.today.to_time.to_i
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue