From d03e62138f017fea2910a1f3655b8a0efb76bd26 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 15:07:07 +0800 Subject: [PATCH] Update personal_books_controller.rb --- app/controllers/personal_books_controller.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index afcb43a..fb2fd14 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -63,12 +63,7 @@ class PersonalBooksController < ApplicationController t << {"value" => "#{book.create_link}"} end when "publish_date", "publication_date" - pd = "" - if !book.publication_date.nil? - pd = book.publication_date.strftime("%Y-%m-%d").split('-') - pd = pd[0]+"/"+pd[1] - end - t << {"value" => pd} + t << {"value" => book.publication_date.strftime("%Y/%m/%d")} when "author_type" t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")} when "language"