Skip to content

Commit

Permalink
Add test cases for period RDATEs
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed May 9, 2024
1 parent 6ad6224 commit 60fa389
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions samples/recur_instances.ics
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ BEGIN:VEVENT
UID:623c13c0-6c2b-45d6-a12b-c33ad61c4868
DESCRIPTION:IAM FOO
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1TU
RDATE:20231123T090000Z
RDATE;VALUE=PERIOD:20231125T090000Z/20231125T123000Z
SUMMARY:Crazy Event Thingy!
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Sahaja
Lal;X-NUM-GUESTS=0:mailto:[email protected]
Expand Down
10 changes: 7 additions & 3 deletions test/recur_expansion_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@ suite('recur_expansion', function() {
let expected = [
new Date('2012-11-05T18:00:00.000Z'),
new Date('2012-11-10T18:00:00.000Z'),
new Date('2012-11-30T18:00:00.000Z')
];
new Date('2012-11-30T18:00:00.000Z'),

// RDATEs
new Date('2023-11-23T09:00:00.000Z'),
new Date('2023-11-25T09:00:00.000Z')
];

let dates = subject.ruleDates.map(function(time) {
return time.toJSDate();
// We have a period in here, take the start date
return (time.start || time).toJSDate();
});

assert.deepEqual(dates, expected);
Expand Down
1 change: 0 additions & 1 deletion test/time_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,6 @@ suite('icaltime', function() {
end: Time.fromString("1970-01-02T03:04:07Z")
});


let dt = Time.fromString('1970-01-02T03:04:05Z');

assert.equal(dt.compare(periodbefore), 1);
Expand Down

0 comments on commit 60fa389

Please sign in to comment.