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

Commit

Permalink
fix(draggableEvents): copy the year when dropping an event on a month…
Browse files Browse the repository at this point in the history
… or year cell

Closes #326
  • Loading branch information
Matt Lewis committed May 11, 2016
1 parent bc07bd6 commit 8467347
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/directives/mwlCalendarMonth.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ angular

var newStart = moment(event.startsAt)
.date(moment(newDayDate).date())
.month(moment(newDayDate).month());
.month(moment(newDayDate).month())
.year(moment(newDayDate).year());

var newEnd = calendarHelper.adjustEndDateFromStartDiff(event.startsAt, newStart, event.endsAt);

Expand Down
4 changes: 3 additions & 1 deletion src/directives/mwlCalendarYear.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ angular
};

vm.handleEventDrop = function(event, newMonthDate) {
var newStart = moment(event.startsAt).month(moment(newMonthDate).month());
var newStart = moment(event.startsAt)
.month(moment(newMonthDate).month())
.year(moment(newMonthDate).year());
var newEnd = calendarHelper.adjustEndDateFromStartDiff(event.startsAt, newStart, event.endsAt);

vm.onEventTimesChanged({
Expand Down

0 comments on commit 8467347

Please sign in to comment.