diff --git a/app/controllers/public/events_controller.rb b/app/controllers/public/events_controller.rb index 976a37d..42c7a8f 100644 --- a/app/controllers/public/events_controller.rb +++ b/app/controllers/public/events_controller.rb @@ -18,7 +18,7 @@ class Public::EventsController < ApplicationController else @start_list_date = Time.now.beginning_of_month - @end_list_date = Event.order("stop_at DESC").first.start_at.end_of_month.next_month + @end_list_date = Event.order("start_at DESC").first.start_at.end_of_month.next_month diff --git a/app/views/public/events/index.html.haml b/app/views/public/events/index.html.haml index 9059e7d..2784ca8 100644 --- a/app/views/public/events/index.html.haml +++ b/app/views/public/events/index.html.haml @@ -8,7 +8,7 @@ -while the_month <= last_month %h2{:class => "month_title"}=l(the_month.to_date, :format => :month_and_year) .month_content - =render :partial => "public/events/event", :collection =>Event.where('(start_at < ? AND start_at > ?) OR (stop_at < ? AND stop_at > ?)',the_month.end_of_month, the_month.beginning_of_month,the_month.end_of_month, the_month.beginning_of_month).order(:start_at) + =render :partial => "public/events/event", :collection =>Event.where('(start_at <= ? AND start_at >= ?) OR (stop_at <= ? AND stop_at >= ?)',the_month.end_of_month, the_month.beginning_of_month,the_month.end_of_month, the_month.beginning_of_month).order(:start_at) -the_month = the_month.next_month