sorting and dates fixed

This commit is contained in:
Harry Bomrah 2015-12-02 18:26:24 +08:00
parent 8406afaef1
commit 45076cd31f
2 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,8 @@ class Book
before_validation :add_http
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc") }
def create_link
title = []
# title << self.member_profile.name if self.member_profile.present?

View File

@ -223,7 +223,7 @@
<div class="control-group">
<label class="control-label muted"><%= t("personal_book.publish_date") %></label>
<div class="controls">
<%= f.datetime_picker :publish_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %>
<%= f.datetime_picker :publish_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @book.publish_date, :new_record => @book.new_record? %>
</div>
</div>
@ -231,7 +231,7 @@
<div class="control-group">
<label class="control-label muted"><%= t("personal_book.publication_date") %></label>
<div class="controls">
<%= f.datetime_picker :publication_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %>
<%= f.datetime_picker :publication_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @book.publication_date, :new_record => @book.new_record? %>
</div>
</div>