canvs / fullcalendar

Automatically exported from code.google.com/p/fullcalendar
0 stars 0 forks source link

Extend an event #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Great calendar by the way :)

I was wondering if I could get just a little help on hacking fullcalendar
to be able to grab a handle on an event and drag to extend the event.  I
have added the handles (div at front and back of the element) and added the
draggable code, I'm just not sure how to best get the event associated with
the handle and alter the start time or end time.

Any help would be appreciated

cory a marsh at gmail dot com

thanks!

Original issue reported on code.google.com by coryama...@gmail.com on 2 Jun 2009 at 11:25

GoogleCodeExporter commented 9 years ago
not sure how you are inserting the handles, but i'd do something like this:

eventRender: function(event, element) {
   element.resizable({
      stop: function() {
          // calculate new start + end times, assign to...
          event.start = ...
          event.end = ...
          $('#yourcalendar').fullCalendar('updateEvent', event);
      }
   });
}

Original comment by adamrs...@gmail.com on 3 Jun 2009 at 5:35

GoogleCodeExporter commented 9 years ago
post another comment if you are still having issues.

Original comment by adamrs...@gmail.com on 6 Jun 2009 at 5:49

GoogleCodeExporter commented 9 years ago
oh no.  I got it all working.  your post was helpful.  I ended up ended up 
replacing
the table with 3 divs, two handles and one content area.  I added new draggable
events to the handles that calculate deltas, and instead of adding the deltas 
to both
start and end, I just add them to start or end respectively.  It was pretty 
easy once
I got a little bit better understanding of jQuery and the calendar code.

Thanks again.  IF you like I can submit my changes?

Original comment by coryama...@gmail.com on 9 Jun 2009 at 10:39

GoogleCodeExporter commented 9 years ago
glad you got it to work. functionality like this will definitely be in a future
release. probably won't be in the next version though, I'm saving all my time to
implement a week-view, but after that, yes. I won't promise that i'll use your 
code
verbatim, but id be interested in looking at it if you want to post it on this 
thread.

Original comment by adamrs...@gmail.com on 15 Jun 2009 at 5:07