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

Commit

Permalink
fix(recursOn): allow recursOn to be an empty string
Browse files Browse the repository at this point in the history
Closes #300
  • Loading branch information
Matt Lewis committed Mar 8, 2016
1 parent 45f016a commit 4bbde4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/calendarHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ angular
var eventEnd = moment(eventPeriod.end);
var periodStart = moment(containerPeriodStart);

if (angular.isDefined(recursOn)) {
if (recursOn) {

switch (recursOn) {
case 'year':
Expand Down
12 changes: 12 additions & 0 deletions test/unit/services/calendarHelper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ describe('calendarHelper', function() {

});

it('should not throw an error when recursOn is an empty string', function() {

expect(function() {
calendarHelper.eventIsInPeriod({
startsAt: new Date(),
endsAt: new Date(),
recursOn: ''
}, periodStart, periodEnd);
}).not.to.throw();

});

it('should use the event start time as the end time when no end time is passed', function() {

var isInPeriod = calendarHelper.eventIsInPeriod({
Expand Down

0 comments on commit 4bbde4e

Please sign in to comment.