public
Description: Travis Vachon's clone of the Cosmo Subversion tree
Homepage: http://chandlerproject.org
Clone URL: git://github.com/travis/cosmo.git
Bug 12206: exdate added after this and future change

git-svn-id: svn+ssh://svn.osafoundation.org/svn/server/cosmo/trunk@7231 
5fd0b11a-f2f7-0310-948e-c8f80ebed640
travis (author)
Tue Jul 08 16:16:12 -0700 2008
commit  6eff58b90177817f8651a27bd6970a3e0f0da6cb
tree    b440cc9923500aff985c9023c0d32bf09aa120fa
parent  4f5b19099131729ab101fd74194d999aaee7e1d0
...
306
307
308
309
 
310
311
312
...
306
307
308
 
309
310
311
312
0
@@ -306,7 +306,7 @@ dojo.declare("cosmo.model.Delta", null, {
0
         newNote.setUid(cosmo.model.uuidGenerator.generate());
0
 
0
         //set the new note's start date to the old occurrence's start date.
0
- newNote.getEventStamp().setStartDate(this._note.recurrenceId);
0
+ newNote.getEventStamp().discardBefore(this._note.recurrenceId);
0
 
0
         //set the old note's rrule end date to just before the break.
0
         var newEndDate = occurrence.getEventStamp().getStartDate().clone();
...
113
114
115
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
118
119
...
113
114
115
 
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
0
@@ -113,7 +113,20 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
            }
0
            
0
         },
0
-
0
+
0
+ // get rid of occurrences before newStartDate
0
+ discardBefore: function (/*cosmo.datetime.Date*/ newStartDate){
0
+ var mods = this.item._modifications;
0
+ for (var key in mods){
0
+ if (newStartDate.after(mods[key].getRecurrenceId()))
0
+ delete mods[key];
0
+ }
0
+ if (this._exdates) this._exdates = dojo.filter(this._exdates,
0
+ function(exdate){return newStartDate.before(exdate);});
0
+
0
+ this.__setProperty("startDate", newStartDate);
0
+ },
0
+
0
         getAtTime: function(){
0
             return !this.getDuration() || this.getDuration().isZero();
0
         },
...
15
16
17
 
18
19
20
...
313
314
315
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
317
318
...
15
16
17
18
19
20
21
...
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
0
@@ -15,6 +15,7 @@
0
 */
0
 dojo.provide("cosmo.model.tests.delta");
0
 dojo.require("cosmo.model.util");
0
+dojo.require("cosmo.model.common");
0
 dojo.require("cosmo.model.Item");
0
 dojo.require("cosmo.model.Delta");
0
 dojo.require("cosmo.model.EventStamp");
0
@@ -313,6 +314,25 @@ function makeItemAllDay(){
0
         delta.deltafy();
0
         var changes = delta.getApplicableChangeTypes();
0
         jum.assertTrue("Master only for series only stamp", setEquals(changes, {master:true}));
0
+ },
0
+
0
+ // bugzilla bug 12206
0
+ function thisAndFutureWithExdate(){
0
+
0
+ // Set up recurrenc
0
+ var note = new cosmo.model.Note();
0
+ note.getEventStamp(true, {
0
+ startDate: new cosmo.datetime.Date(2000, 0, 1),
0
+ rrule: new cosmo.model.RecurrenceRule({frequency: cosmo.model.RRULE_FREQUENCIES.FREQUENCY_DAILY}),
0
+ exdates: [new cosmo.datetime.Date(2000, 0, 2)]
0
+ });
0
+
0
+ var occurrence = note.getNoteOccurrence(new cosmo.datetime.Date(2000, 0, 3));
0
+ var delta = new cosmo.model.Delta(occurrence);
0
+ delta.addStampProperty("event","startDate", new cosmo.datetime.Date(2000, 0, 3, 3));
0
+
0
+ var newItem = delta.applyToOccurrenceAndFuture();
0
+ jum.assertEquals(0, newItem.getEventStamp().getExdates().length);
0
     }
0
 ]);
0
 })();
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@
0
 <html>
0
     <head>
0
     <title>Cosmo service D.O.H. Unit Test Runner</title>
0
- <meta http-equiv="REFRESH" content="0;url=../../util/doh/runner.html?testModule=cosmo.service.tests.module"></HEAD>
0
+ <meta http-equiv="REFRESH" content="0;url=../../../util/doh/runner.html?testModule=cosmo.service.tests.module"></HEAD>
0
     <BODY>
0
         Redirecting to D.O.H runner.
0
     </BODY>

Comments

    No one has commented yet.