fixed some issue
This commit is contained in:
parent
65d2a47c32
commit
fc05dcf303
|
@ -2,7 +2,6 @@ class Dayoff < PersonalPluginIntro
|
||||||
|
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
# validates :dayoff_description, :presence => true
|
|
||||||
|
|
||||||
belongs_to :member_log, :dependent => :destroy
|
belongs_to :member_log, :dependent => :destroy
|
||||||
|
|
||||||
|
@ -11,5 +10,7 @@ class Dayoff < PersonalPluginIntro
|
||||||
field :start_dayoff, :type => DateTime
|
field :start_dayoff, :type => DateTime
|
||||||
field :end_dayoff, :type => DateTime
|
field :end_dayoff, :type => DateTime
|
||||||
|
|
||||||
|
validates :start_dayoff, :presence => true
|
||||||
|
validates :end_dayoff, :presence => true
|
||||||
|
|
||||||
end
|
end
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<div class="alert alert-error">
|
<div class="alert alert-error">
|
||||||
<% @dayoffs.each do |b| %>
|
<% @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>
|
<ul>
|
||||||
【<%= b.dayoff_description %>】
|
【<%= b.dayoff_description %>】
|
||||||
<%= b.start_dayoff.strftime('%Y-%m-%d') %>~
|
<%= b.start_dayoff.strftime('%Y-%m-%d') %>~
|
||||||
|
|
Loading…
Reference in New Issue