From 9cc10eaa643e6844e5bbfdab10003eb8e76f75c7 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 15:32:55 +0800 Subject: [PATCH] Update personal_books_controller.rb --- app/controllers/personal_books_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 5204b63..849b454 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -33,7 +33,7 @@ class PersonalBooksController < ApplicationController books_show = books_temp.select {|value| value.create_link.include? params[:keywords]} end when "publish_date", "publication_date" - books_show = books_temp.select {|value| value.publication_date.strftime("%Y/%m").to_s.include? params[:keywords]} + books_show = books_temp.select {|value| value.publish_date.strftime("%Y/%m/%d").to_s.include? params[:keywords]} when "author_type" books_show = books_temp.select {|value| value.book_author_types.collect{|bat| bat.title}.join(", ").include? params[:keywords]} when "language" @@ -64,7 +64,7 @@ class PersonalBooksController < ApplicationController t << {"value" => "#{book.create_link}"} end when "publish_date", "publication_date" - t << {"value" => (!book.publication_date.nil? ? book.publication_date.strftime('%Y/%m/%d') : "")} + t << {"value" => (!book.publish_date.nil? ? book.publish_date.strftime('%Y/%m') : "")} when "author_type" t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")} when "language"