Change for date
This commit is contained in:
parent
fb53ad524a
commit
efaed060d9
|
@ -300,13 +300,14 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
|
||||
protected
|
||||
|
||||
def delete_out_invalid_date_from_params()
|
||||
def delete_out_invalid_date_from_params
|
||||
if(params[:bulletin]["deadline(1i)"].blank? or params[:bulletin]["deadline(2i)"].blank? or params[:bulletin]["deadline(3i)"].blank?)
|
||||
params[:bulletin].delete("deadline(1i)")
|
||||
params[:bulletin].delete("deadline(2i)")
|
||||
params[:bulletin].delete("deadline(3i)")
|
||||
params[:bulletin].delete("deadline(4i)")
|
||||
params[:bulletin].delete("deadline(5i)")
|
||||
@bulletin.deadline = nil
|
||||
end rescue nil
|
||||
end
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:start) %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_select :postdate, {}, :class => 'input-small' %>
|
||||
<%= f.datetime_select :postdate, { :use_month_numbers => true, :order => [:day, :month, :year] }, :class => 'input-small' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:end) %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_select :deadline, {}, :class => 'input-small' %>
|
||||
<%= f.datetime_select :deadline, { :use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, :class => 'input-small' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -336,11 +336,13 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
|||
|
||||
|
||||
protected
|
||||
def delete_out_invalid_date_from_params()
|
||||
|
||||
def delete_out_invalid_date_from_params
|
||||
if(params[:news_bulletin]["deadline(1i)"].blank? or params[:news_bulletin]["deadline(2i)"].blank? or params[:news_bulletin]["deadline(3i)"].blank?)
|
||||
params[:news_bulletin].delete("deadline(1i)")
|
||||
params[:news_bulletin].delete("deadline(2i)")
|
||||
params[:news_bulletin].delete("deadline(3i)")
|
||||
@news_bulletin.deadline = nil
|
||||
end rescue nil
|
||||
end
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:start) %></label>
|
||||
<div class="controls">
|
||||
<%= f.date_select :postdate, {}, :class => 'input-small' %>
|
||||
<%= f.date_select :postdate, { :use_month_numbers => true, :order => [:day, :month, :year] }, :class => 'input-small' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:end) %></label>
|
||||
<div class="controls">
|
||||
<%= f.date_select :deadline, {}, :class => 'input-small' %>
|
||||
<%= f.date_select :deadline, { :use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, :class => 'input-small' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in New Issue