Browse Source

fix api/users/:login/headmaps.json bug

pull/342/head
chenjing 3 years ago
parent
commit
54b7f2c726
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      app/controllers/users/headmaps_controller.rb

+ 3
- 3
app/controllers/users/headmaps_controller.rb View File

@@ -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


Loading…
Cancel
Save