award date fixed and date format

This commit is contained in:
Harry Bomrah 2016-04-06 14:52:31 +08:00
parent e39650abca
commit 8bcab846c4
1 changed files with 3 additions and 1 deletions

View File

@ -80,7 +80,7 @@ class Honor
elsif t == "honor_type"
pd_data << {"data_title" => (p.honor_type.title rescue "")}
elsif t == "award_date"
pd_data << {"value" => (p.send(fs).strftime("%Y/%m/%d") rescue "")}
pd_data << {"data_title" => (p.send(fs).strftime("%Y/%m/%d") rescue "")}
else
pd_data << { "data_title" => p.send(t) }
end
@ -106,6 +106,8 @@ class Honor
value = I18n.t(self.language) rescue ""
when "honor_type"
value = self.honor_type.title rescue ""
when "award_date"
value = self.award_date.strftime("%Y/%m/%d") rescue ""
else
value = self.send(field) rescue ""
end