From 0de32aa855ad756863a324bdaeae887e1f8955bf Mon Sep 17 00:00:00 2001 From: Andreas Wurzer Date: Wed, 22 Jan 2020 11:14:09 +0100 Subject: [PATCH] fix: modified recurrences are now queried correctly by using new ical.js version --- package.json | 2 +- test/ical-expander.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3702be2..4adfec7 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "node": ">=4" }, "dependencies": { - "ical.js": "1.2.2" + "ical.js": "^1.2.2" }, "devDependencies": { "env": "0.0.2", diff --git a/test/ical-expander.js b/test/ical-expander.js index 9e32af1..8ae6762 100644 --- a/test/ical-expander.js +++ b/test/ical-expander.js @@ -46,14 +46,24 @@ it('should parse issue 285 case correctly', function () { const events = new IcalExpander({ ics: icaljsIssue285 }) .between(new Date('2017-01-03T00:00:00.000Z'), new Date('2017-01-25T00:00:00.000Z')); - assert.deepEqual(events.events.map(e => e.startDate.toJSDate().toISOString()), ['2017-01-18T08:00:00.000Z']); + assert.deepEqual(events.events.map(e => e.startDate.toJSDate().toISOString()), []); assert.deepEqual(events.occurrences.map(e => e.startDate.toJSDate().toISOString()), [ '2017-01-03T08:00:00.000Z', '2017-01-10T08:00:00.000Z', + '2017-01-18T08:00:00.000Z', '2017-01-24T08:00:00.000Z', ]); }); +it('should show recurring modified date using ical.js issue 285', function () { + const events = new IcalExpander({ ics: icaljsIssue285 }) + .between(new Date('2017-01-18T00:00:00.000Z'), new Date('2017-01-19T00:00:00.000Z')); + + assert.equal(events.events.length, 0); + assert.equal(events.occurrences.length, 1); + assert.equal(events.occurrences[0].item.summary, 'test event'); +}); + it('should parse all recurring events without going on forever', function () { const events = new IcalExpander({ ics: recurIcs }) .all();