birthday nil fix

This commit is contained in:
Andreas Stephanides
2014-09-14 02:09:16 +02:00
parent fce2b0a02a
commit c929025cb6
2 changed files with 5 additions and 1 deletions

View File

@@ -54,10 +54,14 @@ end
self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s
end
def birthday
unless self.birth_month.nil? || self.birth_day.nil?
if self.birth_year.nil? || self.birth_year.zero?
Date.new( Date.today.year,self.birth_month,self.birth_day)
else
Date.new( self.birth_year,self.birth_month,self.birth_day)
end
else
nil
end
end
end

View File

@@ -1,5 +1,5 @@
<p>
<b>Geburtstag</b> <%= I18n.l(interninfo.birthday,format: :short) %>
<b>Geburtstag</b> <%= I18n.l(interninfo.birthday,format: :short) unless interninfo.birthday.nil?%>
</p>
<p>
<b>Adresse:</b>