From 5c6e56bb32cae8e19a03a9b8ef1f5f958ebfebeb Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Tue, 24 Jan 2012 12:41:02 +0100 Subject: [PATCH] SONAR-3198 Can't set the due date to the current day --- .../WEB-INF/app/controllers/action_plans_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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') -- 2.39.5