sync fixes
[app.jsdoc] / Date.js
diff --git a/Date.js b/Date.js
index 1653823..78da992 100644 (file)
--- a/Date.js
+++ b/Date.js
@@ -662,7 +662,8 @@ XObject.extend(Date.prototype,
          * Get the number of days in the current month, adjusted for leap year.
          * @return {Number} The number of days in the month
          */
-        getDaysInMonth : function() {
+        getDaysInMonth : function()
+        {
             Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
             return Date.daysInMonth[this.getMonth()];
         },
@@ -671,7 +672,8 @@ XObject.extend(Date.prototype,
          * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
          * @return {String} 'st, 'nd', 'rd' or 'th'
          */
-        getSuffix : function() {
+        getSuffix : function()
+        {
             switch (this.getDate()) {
                 case 1:
                 case 21:
@@ -711,7 +713,8 @@ XObject.extend(Date.prototype,
         </code></pre>
          * @return {Date} The new Date instance
          */
-        clone : function() {
+        clone : function()
+        {
             return new Date(this.getTime());
         },
 
@@ -720,7 +723,8 @@ XObject.extend(Date.prototype,
          @param {Boolean} clone true to create a clone of this date, clear the time and return it
          @return {Date} this or the clone
          */
-        clearTime : function(clone){
+        clearTime : function(clone)
+        {
             if(clone){
                 return this.clone().clearTime();
             }
@@ -755,38 +759,46 @@ XObject.extend(Date.prototype,
          * @param {Number} value      The amount to add to the current date
          * @return {Date} The new Date instance
          */
-        add : function(interval, value){
-          var d = this.clone();
-          if (!interval || value === 0) return d;
-          switch(interval.toLowerCase()){
-            case Date.MILLI:
-              d.setMilliseconds(this.getMilliseconds() + value);
-              break;
-            case Date.SECOND:
-              d.setSeconds(this.getSeconds() + value);
-              break;
-            case Date.MINUTE:
-              d.setMinutes(this.getMinutes() + value);
-              break;
-            case Date.HOUR:
-              d.setHours(this.getHours() + value);
-              break;
-            case Date.DAY:
-              d.setDate(this.getDate() + value);
-              break;
-            case Date.MONTH:
-              var day = this.getDate();
-              if(day > 28){
-                  day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
-              }
-              d.setDate(day);
-              d.setMonth(this.getMonth() + value);
-              break;
-            case Date.YEAR:
-              d.setFullYear(this.getFullYear() + value);
-              break;
-          }
-          return d;
+        add : function(interval, value)
+        {
+            var d = this.clone();
+            if (!interval || value === 0) return d;
+            switch(interval.toLowerCase()){
+                case Date.MILLI:
+                    d.setMilliseconds(this.getMilliseconds() + value);
+                    break;
+                
+                case Date.SECOND:
+                    d.setSeconds(this.getSeconds() + value);
+                    break;
+                
+                case Date.MINUTE:
+                    d.setMinutes(this.getMinutes() + value);
+                    break;
+                
+                case Date.HOUR:
+                    d.setHours(this.getHours() + value);
+                    break;
+                
+                case Date.DAY:
+                    d.setDate(this.getDate() + value);
+                    break;
+                
+                case Date.MONTH:
+                    var day = this.getDate();
+                    if(day > 28){
+                        day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
+                    }
+                    d.setDate(day);
+                    d.setMonth(this.getMonth() + value);
+                    break;
+                
+                case Date.YEAR:
+                    d.setFullYear(this.getFullYear() + value);
+                    break;
+                
+            }
+            return d;
         }
 
 });
\ No newline at end of file