fixed some issue

This commit is contained in:
Keith 2017-02-22 14:36:08 +08:00
parent 65d2a47c32
commit fc05dcf303
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,6 @@ class Dayoff < PersonalPluginIntro
include Mongoid::Document
include Mongoid::Timestamps
# validates :dayoff_description, :presence => true
belongs_to :member_log, :dependent => :destroy
@ -11,5 +10,7 @@ class Dayoff < PersonalPluginIntro
field :start_dayoff, :type => DateTime
field :end_dayoff, :type => DateTime
validates :start_dayoff, :presence => true
validates :end_dayoff, :presence => true
end

View File

@ -17,7 +17,7 @@
<div class="alert alert-error">
<% @dayoffs.each do |b| %>
<% if Time.now <= b.end_dayoff.to_date+40 %>
<% if Time.now.to_date <= b.end_dayoff.to_date+40 %>
<ul>
【<%= b.dayoff_description %>】
<%= b.start_dayoff.strftime('%Y-%m-%d') %>~