show period fix

This commit is contained in:
Harry Bomrah 2016-03-30 16:20:51 +08:00
parent 6916341f5d
commit cd20c50152
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ class Project
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year=>'desc', :period_start_date=>'desc') }
def duration
"#{self.period_start_date.strftime("%Y.%m") rescue ""} ~ #{self.period_end_date.strftime("%Y.%m") rescue ""}"
if !self.send('period_start_date').nil? or !self.send('period_end_date').nil?
date = (self.send('period_start_date').strftime('%Y.%m') rescue "")+' ~ '+(self.send('period_end_date').strftime('%Y.%m') rescue I18n.t('personal_project.up_to_today'))
else
date = ""
end
end
def self.get_plugin_datas_to_member(datas)