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

fix(dayView): correctly display events that finish within 1 hour afte…

…r the day view end

Closes #302
  • Loading branch information...
Matt Lewis
Matt Lewis committed Mar 11, 2016
1 parent dd6f010 commit 3fc4104cf2e9f04ebc5b4276801ee4d75eb15cb0
Showing with 8 additions and 1 deletion.
  1. +1 −1 src/services/calendarHelper.js
  2. +7 −0 test/unit/services/calendarHelper.spec.js
@@ -239,7 +239,7 @@ angular
var dayEndHour = moment(dayViewEnd || '23:00', 'HH:mm').hours();
var hourHeight = (60 / dayViewSplit) * 30;
var calendarStart = moment(viewDate).startOf('day').add(dayStartHour, 'hours');
var calendarEnd = moment(viewDate).startOf('day').add(dayEndHour, 'hours');
var calendarEnd = moment(viewDate).startOf('day').add(dayEndHour + 1, 'hours');
var calendarHeight = (dayEndHour - dayStartHour + 1) * hourHeight;
var hourHeightMultiplier = hourHeight / 60;
var buckets = [];
@@ -521,6 +521,9 @@ describe('calendarHelper', function() {
}, {
startsAt: new Date('October 20, 2015 11:00:00'),
endsAt: new Date('October 20, 2015 12:00:00')
}, {
startsAt: new Date('October 20, 2015 22:00:00'),
endsAt: new Date('October 20, 2015 23:30:00')
}];

dayView = calendarHelper.getDayView(
@@ -552,6 +555,10 @@ describe('calendarHelper', function() {
expect(dayView[2].height).to.equal(60);
});

it('should set the height correctly of events that finish within an hour after the day view end', function() {
expect(dayView[3].height).to.equal(90);
});

it('should never exceed the maximum height of the calendar', function() {
expect(dayView[0].height).to.equal(1440);
});

0 comments on commit 3fc4104

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