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

fix(dayView): use correct height when the end is part of the way thro…

…ugh an hour
  • Loading branch information...
Matt Lewis
Matt Lewis committed Jul 27, 2016
1 parent e0c260c commit beb2d317db0513a861ba4352368a11e0651186bf
Showing with 8 additions and 6 deletions.
  1. +1 −1 src/services/calendarHelper.js
  2. +7 −5 test/unit/services/calendarHelper.spec.js
@@ -314,7 +314,7 @@ angular
var dayViewStartM = moment(dayViewStart || '00:00', 'HH:mm');
var dayViewEndM = moment(dayViewEnd || '23:59', 'HH:mm');
var hourHeight = (60 / dayViewSplit) * 30;
return ((dayViewEndM.diff(dayViewStartM, 'hours') + 1) * hourHeight) + 2;
return ((dayViewEndM.diff(dayViewStartM, 'minutes') / 60) * hourHeight) + 3;
}

function loadTemplates() {
@@ -586,15 +586,17 @@ describe('calendarHelper', function() {
});

describe('getDayViewHeight', function() {
var dayViewHeight;

beforeEach(function() {
dayViewHeight = calendarHelper.getDayViewHeight('01:00', '22:59', 10);
it('should calculate the height of the day view', function() {
var dayViewHeight = calendarHelper.getDayViewHeight('01:00', '22:59', 10);
expect(dayViewHeight).to.equal(3960);
});

it('should calculate the height of the day view', function() {
expect(dayViewHeight).to.equal(3962);
it('should support partial hours', function() {
var dayViewHeight = calendarHelper.getDayViewHeight('01:00', '22:29', 10);
expect(dayViewHeight).to.equal(3870);
});

});

describe('getWeekViewWithTimes', function() {

0 comments on commit beb2d31

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