search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Events can't span more than one week

Asked by Anonymous
10 years ago.

I'm running into a problem with events that span through one week into the next. Using your online demo, create an event on a Tuesday and resize it to span to Friday. Next, move the event so the start date is on Thursday. You would think the event would appear on Thursday - Saturday and again on the following week Sunday. What ends up happening is the event only appears on Sunday. I've also tested this with data from a database. Any events that span two weeks show up only at the end of the event.

I've also tested this on the Pro version and it seems to work normally. I don't see anything in the comparison that would indicate that this is a Pro-only feature. It seems like a pretty basic function to be reserved for the Pro version. Can you confirm if this is a Pro feature or if it's a bug in the MVC Lite version?

Comment posted by Anonymous
10 years ago.

Sorry, should have specified this the Month control. The demo I'm referring to is here:
http://mvc.daypilot.org/demo/Lite/Month/

Comment posted by Anonymous
10 years ago.

I have the same issue here, did you find a solution yet?

Comment posted by Anonymous
10 years ago.

I didn't find a solution. I ended up creating a workaround. I'm only using the calendar to display data. Since users won't be allowed to move objects around I modified the function that I was using to populate my data to split the events that spanned more than a week into multiple events that had the correct start and end dates. The calendar then treats these as different events and puts them in the right place. It's kind of sloppy but it works.

Comment posted by SLu
10 years ago.

I struggled quite long with this and identified _loadEvents as the culprit.
When events are pushed to rows and event spans more than 1 week, same event instance is put to all involved rows which later causes issues. So basically if you push "new DayPilot.Event" per row, it starts to display correctly. Here's my change:

for (var i = 0; i < this.rows.length; i++) {
var row = this.rows[i];
if (row.belongsHere(e)) {
var tmpe = new DayPilot.Event(events[x], this);
row.events.push(tmpe);
}

Hope this helps anyone.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.