Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-09-23 19:28:06 +0300
committerPhil Hughes <me@iamphill.com>2016-10-03 11:55:12 +0300
commita3abfb9708d894b434484fa0e2a836bb0ebd2cdb (patch)
tree25b429aa36ed336385829f1cdcf1b939ea9cce17 /app/helpers/todos_helper.rb
parent08b7480f51f6072ba70b8739301b1ba5d1df1213 (diff)
Moved todo due date text into helper method
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r--app/helpers/todos_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index 1e86f648203..26d61c32744 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -114,6 +114,12 @@ module TodosHelper
selected_type ? selected_type[:text] : default_type
end
+ def todo_due_date(todo)
+ is_due_today = todo.target.due_date.try(:today?)
+
+ "Due #{is_due_today ? "today" : todo.target.due_date.to_s(:medium)}"
+ end
+
private
def show_todo_state?(todo)