]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3198 Can't set the due date to the current day
authorFabrice Bellingard <bellingard@gmail.com>
Tue, 24 Jan 2012 11:41:02 +0000 (12:41 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Tue, 24 Jan 2012 11:41:02 +0000 (12:41 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb

index e031e678c345471b21b5064f3e8214767a67299b..a34905e1662ef7983fe6b8887e688164079be203 100644 (file)
@@ -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')