Skip to content

Commit

Permalink
Use _setTime instead of _setProp for Event.recurrenceId
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Ancona authored and kewisch committed Jan 13, 2020
1 parent f220e29 commit 756f351
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ical/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ ICAL.Event = (function() {
},

set recurrenceId(value) {
this._setProp('recurrence-id', value);
this._setTime('recurrence-id', value);
},

/**
Expand Down
17 changes: 15 additions & 2 deletions test/event_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ suite('ICAL.Event', function() {


var testTzid = 'America/New_York';
testSupport.useTimezones(testTzid);
testSupport.useTimezones(testTzid, 'America/Denver');

var icsData;

Expand Down Expand Up @@ -670,7 +670,6 @@ suite('ICAL.Event', function() {

suite('#' + prop, function() {
var tzid = 'America/Denver';
testSupport.useTimezones(tzid);

setup(function() {
timeProp = primaryItem.getFirstProperty(ical);
Expand Down Expand Up @@ -783,6 +782,20 @@ suite('ICAL.Event', function() {

subject.recurrenceId = changeval;
assert.deepEqual(subject.component.getFirstPropertyValue('recurrence-id'), changeval);

var tzid = 'America/New_York';
var changeval2 = new ICAL.Time({
year: 2012,
month: 1,
day: 1,
hour: 12,
minute: 13,
second: 14,
timezone: tzid
});

subject.recurrenceId = changeval2;
assert.deepEqual(subject.component.getFirstProperty('recurrence-id').getParameter("tzid"), tzid);
});
});

Expand Down

0 comments on commit 756f351

Please sign in to comment.