Fixes activity date param.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2001 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-11-09 17:53:30 +00:00
parent 7619c286cc
commit d63746ab3e
2 changed files with 5 additions and 5 deletions

View File

@ -221,7 +221,7 @@ class ProjectsController < ApplicationController
@days = Setting.activity_days_default.to_i
if params[:from]
begin; @date_to = params[:from].to_date; rescue; end
begin; @date_to = params[:from].to_date + 1; rescue; end
end
@date_to ||= Date.today + 1

View File

@ -22,14 +22,14 @@
<div style="float:left;">
<%= link_to_remote(('&#171; ' + l(:label_previous)),
{:update => "content", :url => params.merge(:from => @date_to - @days), :complete => 'window.scrollTo(0,0)'},
{:href => url_for(params.merge(:from => @date_to - @days)),
{:update => "content", :url => params.merge(:from => @date_to - @days - 1), :complete => 'window.scrollTo(0,0)'},
{:href => url_for(params.merge(:from => @date_to - @days - 1)),
:title => "#{l(:label_date_from)} #{format_date(@date_to - 2*@days)} #{l(:label_date_to).downcase} #{format_date(@date_to - @days - 1)}"}) %>
</div>
<div style="float:right;">
<%= link_to_remote((l(:label_next) + ' &#187;'),
{:update => "content", :url => params.merge(:from => @date_to + @days), :complete => 'window.scrollTo(0,0)'},
{:href => url_for(params.merge(:from => @date_to + @days)),
{:update => "content", :url => params.merge(:from => @date_to + @days - 1), :complete => 'window.scrollTo(0,0)'},
{:href => url_for(params.merge(:from => @date_to + @days - 1)),
:title => "#{l(:label_date_from)} #{format_date(@date_to)} #{l(:label_date_to).downcase} #{format_date(@date_to + @days - 1)}"}) unless @date_to >= Date.today %>
</div>
&nbsp;