public
Description: Travis Vachon's clone of the Cosmo Subversion tree
Homepage: http://chandlerproject.org
Clone URL: git://github.com/travis/cosmo.git
Whitespace and typo fixes.

git-svn-id: svn+ssh://svn.osafoundation.org/svn/server/cosmo/trunk@7232 
5fd0b11a-f2f7-0310-948e-c8f80ebed640
travis (author)
Tue Jul 08 16:16:21 -0700 2008
commit  7047f01a9825544bd0e01dd5cc1a466066c3894c
tree    8149611642c4eccffdb0b44bc0aa26d2d3c847a3
parent  6eff58b90177817f8651a27bd6970a3e0f0da6cb
...
29
30
31
32
 
33
34
35
...
40
41
42
43
 
44
45
46
47
 
48
49
50
...
52
53
54
55
 
56
57
58
...
69
70
71
72
 
 
 
73
74
75
76
77
 
78
79
80
 
81
82
 
83
84
85
 
86
87
88
...
90
91
92
93
94
 
 
95
96
97
98
99
100
101
 
102
103
104
...
106
107
108
109
 
110
111
 
112
113
114
 
115
116
117
...
130
131
132
133
134
135
 
 
 
136
137
138
 
 
139
140
141
142
143
144
145
 
 
 
146
147
148
...
154
155
156
157
 
158
159
160
...
167
168
169
170
 
171
172
173
...
29
30
31
 
32
33
34
35
...
40
41
42
 
43
44
45
46
 
47
48
49
50
...
52
53
54
 
55
56
57
58
...
69
70
71
 
72
73
74
75
76
77
78
 
79
80
81
 
82
83
 
84
85
86
 
87
88
89
90
...
92
93
94
 
 
95
96
97
98
99
100
101
102
 
103
104
105
106
...
108
109
110
 
111
112
 
113
114
115
 
116
117
118
119
...
132
133
134
 
 
 
135
136
137
138
 
 
139
140
141
142
143
144
 
 
 
145
146
147
148
149
150
...
156
157
158
 
159
160
161
162
...
169
170
171
 
172
173
174
175
0
@@ -29,7 +29,7 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
       ["status", String, {}],
0
       ["lastPastOccurrence", cosmo.datetime.Date, {}]
0
     ],
0
- //mixins for master item stamps
0
+ //mixins for master item stamps
0
     {
0
         constructor: function(kwArgs){
0
             this.initializeProperties(kwArgs);
0
@@ -40,11 +40,11 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
             if (duration == null){
0
                 return this.getStartDate();
0
             }
0
-
0
+
0
             if (this.getStartDate() == null){
0
                 return null;
0
             }
0
-
0
+
0
             var endDate = this.getStartDate().clone();
0
             endDate.addDuration(duration);
0
             if (this.getAnyTime() || this.getAllDay()){
0
@@ -52,7 +52,7 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
             }
0
             return endDate;
0
         },
0
-
0
+
0
         getStatus: function(){
0
             if (this.getAnyTime() || this.getAtTime()){
0
                 return null;
0
@@ -69,20 +69,22 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
             var duration = new cosmo.model.Duration(this.getStartDate(), endDate);
0
             this.setDuration(duration);
0
         },
0
-
0
+
0
+ // setStartDate will automatically move recurrences and modifications appropriately,
0
+ // unless noMove is passed
0
         setStartDate: function (/*cosmo.datetime.Date*/ newStartDate){
0
            var oldDate = this.getStartDate();
0
            this.__setProperty("startDate", newStartDate);
0
 
0
- //if this event stamp is attached to an item, and already has a
0
+ //if this event stamp is attached to an item, and already has a
0
            //previous start date we may have some updating to do
0
            if (this.item && oldDate){
0
- var diff = dojo.date.difference(oldDate,
0
+ var diff = dojo.date.difference(oldDate,
0
                    newStartDate, cosmo.datetime.util.dateParts.SECOND);
0
-
0
+
0
                //if there are modifications, we need to move the recurrenceid's for all of them
0
                if (!cosmo.util.lang.isEmpty(this.item._modifications)){
0
-
0
+
0
                    //first copy the modifications into a new hash
0
                    var mods = this.item._modifications;
0
                    var oldMods = {};
0
@@ -90,15 +92,15 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
                    for (var x in mods){
0
                        delete mods[x];
0
                    }
0
- for (var x in oldMods){
0
- var mod = oldMods[x];
0
+ for (var y in oldMods){
0
+ var mod = oldMods[y];
0
                        var rId = mod.getRecurrenceId().clone();
0
                        rId.add(cosmo.datetime.util.dateParts.SECOND, diff);
0
                        mod.setRecurrenceId(rId);
0
                        this.item.addModification(mod);
0
                    }
0
                }
0
-
0
+
0
                //also, if there are exdates, we need to move the recurrenceid's for all of them too
0
                if (this._exdates && this._exdates.length > 0){
0
                    var oldExdates = this._exdates;
0
@@ -106,12 +108,12 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
                    for (var x = 0; x < oldExdates.length; x++){
0
                        var exdate = oldExdates[x];
0
                        exdate.add(cosmo.datetime.util.dateParts.SECOND, diff);
0
- newExdates.push(exdate);
0
+ newExdates.push(exdate);
0
                    }
0
- this._exates = newExdates;
0
+ this._exdates = newExdates;
0
                }
0
            }
0
-
0
+
0
         },
0
 
0
         // get rid of occurrences before newStartDate
0
@@ -130,19 +132,19 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
         getAtTime: function(){
0
             return !this.getDuration() || this.getDuration().isZero();
0
         },
0
-
0
- applyChange: function(propertyName, changeValue, type){
0
- //this handles the case of setting the master start date or end date
0
+
0
+ applyChange: function(propertyName, changeValue, type){
0
+ //this handles the case of setting the master start date or end date
0
             // from an occurrence
0
- if ( (propertyName == "startDate" || propertyName =="endDate")
0
- && type == "master"
0
+ if ( (propertyName == "startDate" || propertyName =="endDate")
0
+ && type == "master"
0
                     && this.isOccurrenceStamp()){
0
                 var getterAndSetter = cosmo.model.util.getGetterAndSetterName(propertyName);
0
                 var getterName = getterAndSetter[0];
0
                 var setterName = getterAndSetter[1];
0
-
0
- var diff = dojo.date.difference(this[getterName](),
0
- changeValue,
0
+
0
+ var diff = dojo.date.difference(this[getterName](),
0
+ changeValue,
0
                             cosmo.datetime.util.dateParts.SECOND);
0
 
0
                 var masterDate = this.getMaster().getEventStamp()[getterName]();
0
@@ -154,7 +156,7 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
                 if (propertyName == "startDate"){
0
                     this.item.recurrenceId.add(cosmo.datetime.util.dateParts.SECOND,diff);
0
                 }
0
- return;
0
+ return;
0
             }
0
             this.inherited("applyChange", arguments);
0
         }
0
@@ -167,7 +169,7 @@ cosmo.model.declareStamp("cosmo.model.EventStamp", "event", "http://osafoundatio
0
                return this.recurrenceId;
0
             }
0
         },
0
-
0
+
0
         //we don't want to inherit from the one from the master....
0
         setStartDate: function (newStartDate){
0
            this.__setProperty("startDate", newStartDate);

Comments

    No one has commented yet.