Merge pull request #708 from raluka/remaining_days
Issue #649: Wrong days remaining label when submitting a new proposal
This commit is contained in:
commit
244ea9d34a
4 changed files with 23 additions and 18 deletions
|
|
@ -63,6 +63,11 @@ class CallForPaper < ActiveRecord::Base
|
|||
&& !self.conference.email_settings.call_for_papers_dates_updates_template.blank?
|
||||
end
|
||||
|
||||
def remaining_days(date = Date.today)
|
||||
result = (self.end_date - date).to_i
|
||||
result > 0 ? result : 0
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def before_end_of_conference
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue