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

fix(recursOn): allow recursOn to be an empty string

Closes #300
  • Loading branch information...
Matt Lewis
Matt Lewis committed Mar 8, 2016
1 parent 45f016a commit 4bbde4e88c9afd9f7b226491bbca2e473aec3beb
Showing with 13 additions and 1 deletion.
  1. +1 −1 src/services/calendarHelper.js
  2. +12 −0 test/unit/services/calendarHelper.spec.js
@@ -30,7 +30,7 @@ angular
var eventEnd = moment(eventPeriod.end);
var periodStart = moment(containerPeriodStart);

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

switch (recursOn) {
case 'year':
@@ -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({

0 comments on commit 4bbde4e

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