From e39650abca37a875c6d3cb1af3ac0f87129beb5f Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 6 Apr 2016 13:27:58 +0800 Subject: [PATCH] modified date --- app/controllers/personal_honors_controller.rb | 2 ++ app/models/honor.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/controllers/personal_honors_controller.rb b/app/controllers/personal_honors_controller.rb index ffa1dda..66dc6c7 100644 --- a/app/controllers/personal_honors_controller.rb +++ b/app/controllers/personal_honors_controller.rb @@ -25,6 +25,8 @@ class PersonalHonorsController < ApplicationController t << {"value" => (honor.send("honor_type").title rescue "")} when "authors" t << {"value" => (honor.send(:member_profile).name rescue "")} + when "award_date" + t << {"value" => (honor.send(fs).strftime("%Y/%m/%d") rescue "")} else t << {"value" => (honor.send(fs) rescue "")} end diff --git a/app/models/honor.rb b/app/models/honor.rb index 99446bf..f55e592 100644 --- a/app/models/honor.rb +++ b/app/models/honor.rb @@ -79,6 +79,8 @@ class Honor pd_data << { "data_title" => "#{p.send(t)}" } 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 "")} else pd_data << { "data_title" => p.send(t) } end