mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
fix api/users/:login/headmaps.json bug
This commit is contained in:
@@ -10,15 +10,15 @@ class Users::HeadmapsController < Users::BaseController
|
||||
private
|
||||
def start_stamp
|
||||
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
|
||||
Date.today.to_time.to_i - 365*24*60*60
|
||||
(Date.today - 1.years).to_time.to_i
|
||||
end
|
||||
end
|
||||
|
||||
def end_stamp
|
||||
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
|
||||
Date.today.to_time.to_i
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user