Commit 1162f8d7 authored by Rubén Dávila's avatar Rubén Dávila

Add elpased time.

parent 4e8266e8
......@@ -11,3 +11,7 @@ li.milestone {
height: 6px;
}
}
.time-elapsed {
color: #F14539;
}
......@@ -110,6 +110,15 @@ class Milestone < ActiveRecord::Base
0
end
def percent_time_used
return 100 if expired?
duration = ((created_at - due_date.to_datetime) / 1.day)
days_elapsed = ((created_at - Time.now) / 1.day)
((days_elapsed.to_f / duration) * 100).floor
end
def expires_at
if due_date
if due_date.past?
......
......@@ -57,6 +57,9 @@
closed
%strong== #{@milestone.percent_complete}%
complete
%span.time-elapsed
%strong== #{@milestone.percent_time_used}%
time elapsed
%span.pull-right= @milestone.expires_at
= milestone_progress_bar(@milestone)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment