From 8bcab846c4e1a7965cdab500d5e28cf19fcb42ea Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 6 Apr 2016 14:52:31 +0800 Subject: [PATCH] award date fixed and date format --- app/models/honor.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/honor.rb b/app/models/honor.rb index f55e592..22fb9e7 100644 --- a/app/models/honor.rb +++ b/app/models/honor.rb @@ -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