Meilleur gestion des DateTime
This commit is contained in:
parent
144ab80fec
commit
e815c78c33
|
@ -12,10 +12,10 @@ class Event < ActiveRecord::Base
|
||||||
|
|
||||||
|
|
||||||
scope :moderated, -> { where moderated: true }
|
scope :moderated, -> { where moderated: true }
|
||||||
scope :past, -> { where('end_time < ?', Date.today).order(start_time: :desc) }
|
scope :past, -> { where('end_time < ?', DateTime.now).order(start_time: :desc) }
|
||||||
scope :future, -> { where('end_time >= ?', Date.today).order(start_time: :asc) }
|
scope :future, -> { where('end_time >= ?', DateTime.now).order(start_time: :asc) }
|
||||||
scope :future_30, -> {
|
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
|
.order :start_time
|
||||||
}
|
}
|
||||||
scope :year, -> year {
|
scope :year, -> year {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
= render '/lugs/search' unless controller.controller_name == 'lugs'
|
= render '/lugs/search' unless controller.controller_name == 'lugs'
|
||||||
|
|
||||||
-# Seems necessary, for the time being, to ensure calendar is changing days correctly
|
-# Seems necessary, for the time being, to ensure calendar is changing days correctly
|
||||||
- config.time_zone = 'Paris'
|
- Time.zone = 'Paris'
|
||||||
|
|
||||||
%form.region_selector
|
%form.region_selector
|
||||||
- if params[:start_date]
|
- if params[:start_date]
|
||||||
|
|
Loading…
Reference in New Issue