My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 76: Modify event element start date damages rendering
1 person starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Aug 2009


Sign in to add a comment
 
Reported by ztra...@gmail.com, Aug 10, 2009
What steps will reproduce the problem?

1.Have events fetched from some source (In my case, a php json encoded array)

2.On event drop, check if new date is before today (new Date()) and if it
is, revert date with:
event.start.setTime(event.start.getTime() - 86400*delta*1000);
I also tried with get/setDate and substracted delta.

3.

What is the expected output? What do you see instead?

Calendar render is wrong. If the title fits in one single line inside de
day box, the width is not 100% of the day box anymore but exactly the title
width. If, otherwise, the title is long, the event looks like is extended
tgrough some more days having the width of the event's title.
The event starts really in the new (modified, not dropped one) date but
render is wrong and is impossible to drag/drop again: it disappears. 

What version of the product are you using? On what operating system?
On Ubuntu server PHP (also tested on WAMP) Latest version of fullCalendar
with jQuery 132. Tested on Firefox 3 and 3.5 lastest. Also IE 7 and 8

Please provide any additional information below.

this is the code of the method:

eventDrop: function(event, delta) {
	if (event.start < new Date()){
		event.start.setTime(event.start.getTime() - 86400*delta*1000);
		$('#calendar').fullCalendar('updateEvent', event);
	}else{
		alert("evento movido");
	}
},
Aug 30, 2009
Project Member #1 adamrs...@gmail.com
hey ztrange,

the reason is it screwing up is b/c by the time the eventDrop handler is called, the 
event's start time has already been modified. in your example, you are incrementing it 
AGAIN if event.start < new Date()

currently, there is no way to elegantly revert an event to the start/end BEFORE the 
drag, see https://code.google.com/p/fullcalendar/issues/detail?id=84 for an ongoing 
discussion about this.

thank you for reporting this, i am going to close this bug, but if you believe the 
rendering is messing up for any OTHER reasons, please reply to this thread. thanks.
Status: Done
Sign in to add a comment

Powered by Google Project Hosting