Skip to content

Commit 8cbe7b4

Browse files
authored
Merge pull request #16 from andeee/fix-modified-recurrence-2
fix: modified recurrences are now queried correctly
2 parents 3f174f2 + 0de32aa commit 8cbe7b4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"node": ">=4"
2222
},
2323
"dependencies": {
24-
"ical.js": "1.2.2"
24+
"ical.js": "^1.2.2"
2525
},
2626
"devDependencies": {
2727
"env": "0.0.2",

test/ical-expander.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,24 @@ it('should parse issue 285 case correctly', function () {
4646
const events = new IcalExpander({ ics: icaljsIssue285 })
4747
.between(new Date('2017-01-03T00:00:00.000Z'), new Date('2017-01-25T00:00:00.000Z'));
4848

49-
assert.deepEqual(events.events.map(e => e.startDate.toJSDate().toISOString()), ['2017-01-18T08:00:00.000Z']);
49+
assert.deepEqual(events.events.map(e => e.startDate.toJSDate().toISOString()), []);
5050
assert.deepEqual(events.occurrences.map(e => e.startDate.toJSDate().toISOString()), [
5151
'2017-01-03T08:00:00.000Z',
5252
'2017-01-10T08:00:00.000Z',
53+
'2017-01-18T08:00:00.000Z',
5354
'2017-01-24T08:00:00.000Z',
5455
]);
5556
});
5657

58+
it('should show recurring modified date using ical.js issue 285', function () {
59+
const events = new IcalExpander({ ics: icaljsIssue285 })
60+
.between(new Date('2017-01-18T00:00:00.000Z'), new Date('2017-01-19T00:00:00.000Z'));
61+
62+
assert.equal(events.events.length, 0);
63+
assert.equal(events.occurrences.length, 1);
64+
assert.equal(events.occurrences[0].item.summary, 'test event');
65+
});
66+
5767
it('should parse all recurring events without going on forever', function () {
5868
const events = new IcalExpander({ ics: recurIcs })
5969
.all();

0 commit comments

Comments
 (0)