Meilleur gestion des DateTime

This commit is contained in:
echarp 2014-08-01 00:40:26 +02:00
parent 144ab80fec
commit e815c78c33
2 changed files with 4 additions and 4 deletions

View File

@ -12,10 +12,10 @@ class Event < ActiveRecord::Base
scope :moderated, -> { where moderated: true }
scope :past, -> { where('end_time < ?', Date.today).order(start_time: :desc) }
scope :future, -> { where('end_time >= ?', Date.today).order(start_time: :asc) }
scope :past, -> { where('end_time < ?', DateTime.now).order(start_time: :desc) }
scope :future, -> { where('end_time >= ?', DateTime.now).order(start_time: :asc) }
scope :future_30, -> {
where('start_time >= ? and end_time <= ?', Date.today, Date.today + 30)
where('start_time >= ? and end_time <= ?', DateTime.now, 30.days.from_now)
.order :start_time
}
scope :year, -> year {

View File

@ -1,7 +1,7 @@
= render '/lugs/search' unless controller.controller_name == 'lugs'
-# Seems necessary, for the time being, to ensure calendar is changing days correctly
- config.time_zone = 'Paris'
- Time.zone = 'Paris'
%form.region_selector
- if params[:start_date]