Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
fix(weekViewWithTimes): more robust fix for event offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Jun 29, 2016
1 parent 57d9e49 commit 721b3fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@
}
},
"dependencies": {
"calendar-utils": "0.0.2"
"calendar-utils": "0.0.3"
}
}
11 changes: 7 additions & 4 deletions src/services/calendarHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand All @@ -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;
Expand Down

0 comments on commit 721b3fc

Please sign in to comment.