From: Fabrice Bellingard Date: Tue, 24 Jan 2012 11:41:02 +0000 (+0100) Subject: SONAR-3198 Can't set the due date to the current day X-Git-Tag: 2.14~253 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5c6e56bb32cae8e19a03a9b8ef1f5f958ebfebeb;p=sonarqube.git SONAR-3198 Can't set the due date to the current day --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb index e031e678c34..a34905e1662 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb @@ -47,10 +47,11 @@ class ActionPlansController < ApplicationController unless params[:dead_line].blank? begin dead_line = DateTime.strptime(params[:dead_line], '%d/%m/%Y') - if dead_line.past? - date_not_valid = message('action_plans.date_cant_be_in_past') - else + # we check if the date is today or in the future + if dead_line > 1.day.ago @action_plan.dead_line = dead_line + else + date_not_valid = message('action_plans.date_cant_be_in_past') end rescue date_not_valid = message('action_plans.date_not_valid')