Skip to main content
Ask A Question
Notifications
You’re not receiving notifications from this thread.
Subscribe

Multiday with calendar gem

General • Asked by John Munyi

Is possible you shed some more light on this ....

which is the best approach in my event.rb i so fat have this

  class Event < ActiveRecord::Base
    belongs_to :user

 def duration
   end_time - start_time
 end

 def event_length(start_time)
   start_time + (duration*24*60*60)  
  end
  end

wondering how to pass on the value returned by event_length to the calendar and have the event displayed across multiple days


So right now there's no way to do that with simple_calendar. It's a somewhat complicated thing to do to reproduce Google Calendar style multi-day events.

One option you have is to add some code to the view to look for events that started before the current and end on or after it to find multi-day events. You can create a helper to do that or add some code to your controller.

At some point I'll be patching that in simple_calendar to help make it easier.


hey Chris , thanks for the update ... anyother gems you would recommend that would handle that in a simpler mannner ?


Maybe Javascript libraries like http://fullcalendar.io/ but no gems that I'm aware of.


cool... wil check it out .. thanks


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 29,763+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.