diff options
author | Alex Legler <a3li@gentoo.org> | 2011-12-18 16:58:24 +0100 |
---|---|---|
committer | Alex Legler <a3li@gentoo.org> | 2011-12-18 16:58:24 +0100 |
commit | 6105e6d8fbda611972ef6315e4c4c23d4edb24de (patch) | |
tree | 59f69e7c1a36b9c6512ac2821085dceaa7f7fa2e | |
parent | Revamp comment stuff layout, now with full markdown in comments (diff) | |
download | glsamaker-6105e6d8fbda611972ef6315e4c4c23d4edb24de.tar.gz glsamaker-6105e6d8fbda611972ef6315e4c4c23d4edb24de.tar.bz2 glsamaker-6105e6d8fbda611972ef6315e4c4c23d4edb24de.zip |
Fix archive display in December. Thanks to ackle for the report
-rw-r--r-- | app/controllers/glsa_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/glsa_controller.rb b/app/controllers/glsa_controller.rb index 657af5c..72f559a 100644 --- a/app/controllers/glsa_controller.rb +++ b/app/controllers/glsa_controller.rb @@ -33,7 +33,11 @@ class GlsaController < ApplicationController @year = (params[:year] || Date.today.year).to_i month_start = Date.new(@year, @month, 1) - month_end = Date.new(@year, @month + 1, 1) - 1 + if @month == 12 + month_end = Date.new(@year + 1, 1, 1) -1 + else + month_end = Date.new(@year, @month + 1, 1) - 1 + end @glsas = Glsa.where(:status => 'release', :first_released_at => month_start..month_end).order('updated_at DESC') } |