Ask A Question

Notifications

You’re not receiving notifications from this thread.

Multiday with calendar gem

JM asked in General

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

Reply

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.

Reply

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

Reply

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

Reply

cool... wil check it out .. thanks

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.