Skip to content

Commit

Permalink
fix DAILY frequency when only 1 BYHOUR is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
arolson101 committed Feb 14, 2018
1 parent 1aa59b7 commit 6fd1e1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/nlp.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@
},

list: function (arr, callback, finalDelim, delim) {
if (!(arr instanceof Array)) {
arr = [arr]
}
var delimJoin = function (array, delimiter, finalDelimiter) {
var list = ''

Expand Down
12 changes: 12 additions & 0 deletions test/rrule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3524,4 +3524,16 @@ describe('RRule', function () {
assert.equal(rrstr, newrr.toString())
})
})

it('testByHourValues', function () {
[
['DTSTART=20171101T010000Z;UNTIL=20171214T013000Z;FREQ=DAILY;INTERVAL=2;WKST=MO;BYHOUR=11,12;BYMINUTE=30;BYSECOND=0', 'every 2 days at 11 and 12 until December 13, 2017'],
['DTSTART=20171101T010000Z;UNTIL=20171214T013000Z;FREQ=DAILY;INTERVAL=2;WKST=MO;BYHOUR=11;BYMINUTE=30;BYSECOND=0', 'every 2 days at 11 until December 13, 2017']
].forEach(function (pair) {
var rule = pair[0]
var str = pair[1]
var rr = RRule.fromString(rule)
assert.equal(rr.toText(), str)
})
})
})

0 comments on commit 6fd1e1e

Please sign in to comment.