small fix for dates

This commit is contained in:
Harry Bomrah 2016-04-06 13:12:20 +08:00
parent b4ddea2aca
commit ac11037166
2 changed files with 4 additions and 4 deletions

View File

@ -34,8 +34,8 @@ class PersonalBooksController < ApplicationController
end
when "publish_date", "publication_date"
pd = ""
if !book.publish_date.nil?
pd = book.publish_date.strftime("%Y-%m-%d").split('-')
if !book.publication_date.nil?
pd = book.publication_date.strftime("%Y-%m-%d").split('-')
pd = pd[0]+"/"+pd[1]
end
t << {"value" => pd}

View File

@ -110,8 +110,8 @@ class Book
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_book')}' target='_blank'>#{p.send(t)}</a>" }
when "publish_date", "publication_date"
pd = ""
if !p.publish_date.nil?
pd = p.publish_date.strftime("%Y-%m-%d").split('-')
if !p.publication_date.nil?
pd = p.publication_date.strftime("%Y-%m-%d").split('-')
pd = pd[0]+"/"+pd[1]
end
pd_data << {"data_title" => pd}