Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix(weekViewWithTimes): more robust fix for event offsets

  • Loading branch information...
Matt Lewis
Matt Lewis committed Jun 29, 2016
1 parent 57d9e49 commit 721b3fc2240b2d090c42847e13106ad9f3ed03e1
Showing with 8 additions and 5 deletions.
  1. +1 −1 package.json
  2. +7 −4 src/services/calendarHelper.js
@@ -85,6 +85,6 @@
}
},
"dependencies": {
"calendar-utils": "0.0.2"
"calendar-utils": "0.0.3"
}
}
@@ -313,7 +313,6 @@ angular
var flattenedEvents = [];
weekView.eventRows.forEach(function(row) {
row.row.forEach(function(eventRow) {
eventRow.event.dayOffset = eventRow.offset;
flattenedEvents.push(eventRow.event);
});
});
@@ -332,9 +331,13 @@ angular
});
weekView.eventRows = [{
row: newEvents.map(function(event) {
var offset = event.dayOffset;
delete event.dayOffset;
return {event: event, offset: offset};
return {
event: event,
offset: calendarUtils.getDayOffset(
{start: event.startsAt, end: event.endsAt},
moment(viewDate).startOf('week')
)
};
})
}];
return weekView;

0 comments on commit 721b3fc

Please sign in to comment.
You can’t perform that action at this time.