Fix date bugs

This commit is contained in:
Christophe Vilayphiou 2012-05-25 09:59:39 +08:00
parent 71d4241a2f
commit 75b67dddf5
2 changed files with 5 additions and 5 deletions

View File

@ -135,7 +135,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
else
@bulletin = Bulletin.new(params[:bulletin])
@bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate
@bulletin.deadline = nil if (@bulletin.deadline < @bulletin.postdate rescue nil)
@bulletin.create_user_id = current_user.id
@bulletin.update_user_id = current_user.id
@ -244,7 +244,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
else
@bulletin = Bulletin.find(params[:id])
@bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate
@bulletin.deadline = nil if (@bulletin.deadline < @bulletin.postdate rescue nil)
@bulletin.update_user_id = current_user.id

View File

@ -36,7 +36,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
# @news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered_news_bulletins : NewsBulletin.all.page(params[:page]).per(10)
@news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("news_bulletin") : NewsBulletin.all.page(params[:page]).per(10)
@news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("news_bulletin") : get_viewable("news_bulletin")
@news_bulletin_categories = NewsBulletinCategory.all
@news_bulletin_link = NewsBulletinLink.new
@ -136,7 +136,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
else
@news_bulletin = NewsBulletin.new(params[:news_bulletin])
@news_bulletin.deadline = nil if @news_bulletin.deadline < @news_bulletin.postdate
@news_bulletin.deadline = nil if (@news_bulletin.deadline < @news_bulletin.postdate rescue nil)
@news_bulletin.create_user_id = current_user.id
@news_bulletin.update_user_id = current_user.id
@ -245,7 +245,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
else
@news_bulletin = NewsBulletin.find(params[:id])
@news_bulletin.deadline = nil if @news_bulletin.deadline < @news_bulletin.postdate
@news_bulletin.deadline = nil if (@news_bulletin.deadline < @news_bulletin.postdate rescue nil)
@news_bulletin.update_user_id = current_user.id