Bug 1280898 - Set up eslint for calendar files - (almost) enable space-infix-ops rule. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Fri, 08 Jul 2016 11:19:06 +0200
changeset 25956 aa60248fbd5094b03a082eca1685cf1062cbbf28
parent 25955 bd2023dedb868294992a355e3302f08d5e65ce01
child 25957 eb767f75b68dc2b4b605dd456852dacf19ede617
push id1771
push userclokep@gmail.com
push dateMon, 14 Nov 2016 17:47:53 +0000
treeherdercomm-beta@399ae9d71595 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1280898
Bug 1280898 - Set up eslint for calendar files - (almost) enable space-infix-ops rule. r=MakeMyDay MozReview-Commit-ID: AFQU6cqr9BX
calendar/.eslintrc
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-base-view.xml
calendar/base/content/calendar-daypicker.xml
calendar/base/content/calendar-extract.js
calendar/base/content/calendar-month-view.xml
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-task-tree.xml
calendar/base/content/calendar-ui-utils.js
calendar/base/content/dialogs/calendar-dialog-utils.js
calendar/base/content/dialogs/calendar-event-dialog-attendees.js
calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
calendar/base/content/dialogs/calendar-event-dialog-timezone.js
calendar/base/content/import-export.js
calendar/base/content/preferences/alarms.js
calendar/base/content/preferences/categories.js
calendar/base/content/today-pane.js
calendar/base/content/widgets/calendar-list-tree.xml
calendar/base/content/widgets/calendar-widgets.xml
calendar/base/content/widgets/minimonth.xml
calendar/base/modules/calAuthUtils.jsm
calendar/base/modules/calExtract.jsm
calendar/base/modules/calProviderUtils.jsm
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/src/calCachedCalendar.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calIcsParser.js
calendar/base/src/calRecurrenceInfo.js
calendar/base/src/calTimezoneService.js
calendar/base/src/calWeekInfoService.js
calendar/import-export/calOutlookCSVImportExport.js
calendar/providers/caldav/calDavCalendar.js
calendar/providers/caldav/calDavRequestHandlers.js
calendar/providers/ics/calICSCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/storage/calStorageUpgrade.jsm
calendar/providers/wcap/calWcapCalendarItems.js
calendar/resources/content/datetimepickers/datetimepickers.xml
calendar/resources/content/mouseoverPreviews.js
calendar/resources/content/publish.js
calendar/test/mozmill/eventDialog/testEventDialog.js
calendar/test/mozmill/testTodayPane.js
calendar/test/mozmill/views/testMonthView.js
calendar/test/mozmill/views/testMultiweekView.js
calendar/test/unit/test_attendee.js
calendar/test/unit/test_bug1199942.js
calendar/test/unit/test_datetime.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_ics_service.js
calendar/test/unit/test_recur.js
--- a/calendar/.eslintrc
+++ b/calendar/.eslintrc
@@ -137,16 +137,20 @@
     // Disallow the use of Boolean literals in conditional expressions.
     "no-unneeded-ternary": 2,
 
     // Disallow use of multiple spaces (sometimes used to align const values,
     // array or object items, etc.). It's hard to maintain and doesn't add that
     // much benefit.
     "no-multi-spaces": 2,
 
+    // Require spaces around operators, except for a|0.
+    // Disabled for now given eslint doesn't support default args yet
+    // "space-infix-ops": [2, {"int32Hint": true}],
+
     // Will enable these rules later
     "keyword-spacing": 0,
     "block-spacing": 0,
     "no-lonely-if": 0,
     "space-before-blocks": 0,
     "computed-property-spacing": 0,
     "consistent-return": 0,
     "no-redeclare": 0,
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -118,17 +118,17 @@ function removePeriodListItem(aPeriod) {
  * @param event     The DOM event that triggered the checkbox state change.
  */
 agendaListbox.onCheckboxChange =
 function onCheckboxChange(event) {
     var periodCheckbox = event.target;
     var lopen = (periodCheckbox.getAttribute("checked") == "true");
     var listItem = getParentNodeOrThis(periodCheckbox, "agenda-checkbox-richlist-item");
     var period = listItem.getItem();
-    period.open= lopen;
+    period.open = lopen;
     // as the agenda-checkboxes are only transient we have to set the "checked"
     // attribute at their hidden origins to make that attribute persistent.
     document.getElementById(listItem.id + "-hidden").setAttribute("checked",
                             periodCheckbox.getAttribute("checked"));
     if (lopen) {
         agendaListbox.refreshCalendarQuery(period.start, period.end);
     } else {
         listItem = listItem.nextSibling;
--- a/calendar/base/content/calendar-base-view.xml
+++ b/calendar/base/content/calendar-base-view.xml
@@ -662,17 +662,17 @@
             const weekPrefix = "calendar.week.";
             const prefNames = ["d0sundaysoff", "d1mondaysoff", "d2tuesdaysoff",
                                "d3wednesdaysoff", "d4thursdaysoff",
                                "d5fridaysoff", "d6saturdaysoff"];
             const defaults = ["true", "false", "false", "false",
                               "false", "false", "true"];
             let daysOff = [];
             for (let i in prefNames) {
-                if (Preferences.get(weekPrefix+prefNames[i])) {
+                if (Preferences.get(weekPrefix + prefNames[i])) {
                     daysOff.push(Number(i));
                 }
             }
             this.daysOffArray = daysOff;
         ]]></body>
       </method>
 
       <method name="refreshView">
--- a/calendar/base/content/calendar-daypicker.xml
+++ b/calendar/base/content/calendar-daypicker.xml
@@ -26,17 +26,17 @@
                    xbl:inherits="value=label"/>
       </xul:hbox>
     </content>
     <implementation>
       <method name="onmodified">
         <parameter name="aEvent"/>
         <body>
           <![CDATA[
-            if (aEvent.attrName =="checked") {
+            if (aEvent.attrName == "checked") {
                 var event = document.createEvent('Events');
                 event.initEvent('select', true, true);
                 this.calendar.dispatchEvent(event);
             }
           ]]>
         </body>
       </method>
       <constructor>
--- a/calendar/base/content/calendar-extract.js
+++ b/calendar/base/content/calendar-extract.js
@@ -83,17 +83,17 @@ var calendarExtract = {
         let content = folder.getMsgTextFromStream(listener.inputStream,
                                                   message.Charset,
                                                   65536,
                                                   32768,
                                                   false,
                                                   true,
                                                   { });
         cal.LOG("[calExtract] Original email content: \n" + title + "\r\n" + content);
-        let date = new Date(message.date/1000);
+        let date = new Date(message.date / 1000);
         let time = (new Date()).getTime();
 
         let locale = Preferences.get("general.useragent.locale", "en-US");
         let dayStart = Preferences.get("calendar.view.daystarthour", 6);
         let extractor;
 
         if (fixedLang) {
             extractor = new Extractor(fixedLocale, dayStart);
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -214,17 +214,17 @@
           // Set up DOM attributes for custom CSS coloring.
           let weekTitle = cal.getWeekInfoService().getWeekTitle(aDate);
           this.setAttribute("year", aDate.year);
           this.setAttribute("month", aDate.month + 1);
           this.setAttribute("week", weekTitle);
           this.setAttribute("day", aDate.day);
 
           if (this.mShowMonthLabel) {
-             let monthName = calGetString("dateFormat", "month." + (aDate.month+1) + ".Mmm");
+             let monthName = calGetString("dateFormat", "month." + (aDate.month + 1) + ".Mmm");
              this.setAttribute("value", aDate.day + " " + monthName);
           } else {
              this.setAttribute("value", aDate.day);
           }
         ]]></body>
       </method>
 
       <method name="addItem">
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -23,18 +23,18 @@
       <xul:stack anonid="timebarboxstack" style="display: block; position: relative" xbl:inherits="orient,width,height" flex="1">
         <xul:box anonid="topbox" xbl:inherits="orient,width,height" flex="1"/>
         <xul:box anonid="timeIndicatorBoxTimeBar" class="timeIndicator-timeBar" xbl:inherits="orient" hidden="true"/>
       </xul:stack>
     </content>
 
     <implementation>
       <field name="mPixPerMin">0.6</field>
-      <field name="mStartMin">0*60</field>
-      <field name="mEndMin">24*60</field>
+      <field name="mStartMin">0</field>
+      <field name="mEndMin">24 * 60</field>
       <field name="mDayStartHour">0</field>
       <field name="mDayEndHour">24</field>
 
       <constructor>
         this.relayout();
       </constructor>
 
       <method name="setDayStartEndHours">
@@ -251,20 +251,20 @@
       <constructor><![CDATA[
         this.mEventInfos = [];
         this.mTimezone = UTC();
         this.mSelectedItemIds = {};
       ]]></constructor>
 
       <!-- fields -->
       <field name="mPixPerMin">0.6</field>
-      <field name="mStartMin">0*60</field>
-      <field name="mEndMin">24*60</field>
-      <field name="mDayStartMin">8*60</field>
-      <field name="mDayEndMin">17*60</field>
+      <field name="mStartMin">0</field>
+      <field name="mEndMin">24 * 60</field>
+      <field name="mDayStartMin">8 * 60</field>
+      <field name="mDayEndMin">17 * 60</field>
       <!--an array of objects that contain information about the events that are to be
       displayed. The contained fields are:
       event:        The event that is to be displayed in a 'calendar-event-box'
       layoutStart:  The 'start'-datetime object of the event in the timezone of the view
       layoutEnd:    The 'end'-datetime object of the event in the timezone of the view.
                     The 'layoutEnd' may be different from the real 'end' time of the
                     event because it considers a certain minimum duration of the event
                     that is basically dependent of the font-size of the event-box label -->
@@ -1017,18 +1017,18 @@
               //       |      |______|      |
               //       |      |      |______|
               //       |      |_____________|
               //       |      |ev2          |
               //       |______|             |<--If our item's start time is
               //       |      |_____________|   here, we can shrink ev2 and jump
               //       |      |      |      |   in column #3
               //
-              for (var jj=1; jj<colEndArray.length; ++jj) {
-                  if (colEndArray[jj].event.hashId == colEndArray[jj-1].event.hashId) {
+              for (var jj = 1; jj < colEndArray.length; ++jj) {
+                  if (colEndArray[jj].event.hashId == colEndArray[jj - 1].event.hashId) {
                       // Good we found a item that spanned multiple columns.
                       // Find it in the blob so we can modify its properties
                       for (var kk in currentBlob) {
                           if (currentBlob[kk].itemInfo.event.hashId == colEndArray[jj].event.hashId) {
                               // Take all but the first spot that the item spanned
                               var spanOfShrunkItem = currentBlob[kk].colSpan;
                               currentBlob.push({itemInfo: curItemInfo,
                                                 startCol: Number(currentBlob[kk].startCol) + 1,
@@ -2017,17 +2017,17 @@
 
           let interval = this.mPixPerMin * ROUND_INTERVAL;
           let pos;
           if (this.getAttribute("orient") == "vertical") {
               pos = event.screenY - this.parentNode.boxObject.screenY;
           } else {
               pos = event.screenX - this.parentNode.boxObject.screenX;
           }
-          newStart.minute = (Math.round(pos/interval) * ROUND_INTERVAL) + this.mStartMin;
+          newStart.minute = (Math.round(pos / interval) * ROUND_INTERVAL) + this.mStartMin;
           event.stopPropagation();
           return newStart;
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="dblclick" button="0"><![CDATA[
@@ -2083,23 +2083,23 @@
         let snapIntMin = (event.shiftKey &&
                           !event.ctrlKey &&
                           !event.altKey &&
                           !event.metaKey) ? 1 : 15;
         let interval = this.mPixPerMin * snapIntMin;
 
         if (this.getAttribute("orient") == "vertical") {
             this.mDragState.origLoc = event.screenY;
-            this.mDragState.origMin = Math.floor((event.screenY - this.parentNode.boxObject.screenY)/interval) * snapIntMin;
+            this.mDragState.origMin = Math.floor((event.screenY - this.parentNode.boxObject.screenY) / interval) * snapIntMin;
             this.mDragState.limitEndMin = this.mDragState.origMin;
             this.mDragState.limitStartMin = this.mDragState.origMin;
             this.fgboxes.dragspacer.setAttribute("height", this.mDragState.origMin * this.mPixPerMin);
         } else {
             this.mDragState.origLoc = event.screenX;
-            this.mDragState.origMin = Math.floor((event.screenX - this.parentNode.boxObject.screenX)/interval) * snapIntMin;
+            this.mDragState.origMin = Math.floor((event.screenX - this.parentNode.boxObject.screenX) / interval) * snapIntMin;
             this.fgboxes.dragspacer.setAttribute("width", this.mDragState.origMin * this.mPixPerMin);
         }
 
         document.calendarEventColumnDragging = this;
 
         window.addEventListener("mousemove", this.onEventSweepMouseMove, false);
         window.addEventListener("mouseup", this.onEventSweepMouseUp, false);
         window.addEventListener("keypress", this.onEventSweepKeypress, false);
@@ -2404,17 +2404,17 @@
             // Use <description> textContent so it can wrap.
             evl.textContent = item.title;
           } else {
             evl.textContent = calGetString("calendar", "eventUntitled");
           }
 
           var gripbar = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1").boxObject.height;
           var height = document.getAnonymousElementByAttribute(this, "anonid", "eventbox").boxObject.height;
-          evl.setAttribute("style", "max-height: " + Math.max(0, height-gripbar*2) + "px");
+          evl.setAttribute("style", "max-height: " + Math.max(0, height-gripbar * 2) + "px");
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="mousedown" button="0"><![CDATA[
         event.stopPropagation();
 
@@ -2450,17 +2450,17 @@
       <handler event="mousemove"><![CDATA[
         if (!this.mInMouseDown) {
             return;
         }
 
         var dx = Math.abs(event.screenX - this.mMouseX);
         var dy = Math.abs(event.screenY - this.mMouseY);
         // more than a 3 pixel move?
-        if ((dx*dx + dy*dy) > 9) {
+        if ((dx * dx + dy * dy) > 9) {
             if (this.parentColumn) {
                 if (this.editingTimer) {
                     clearTimeout(this.editingTimer);
                     this.editingTimer = null;
                 }
 
                 this.calendarView.setSelectedItems(1, [this.mOccurrence]);
 
@@ -2743,21 +2743,21 @@
       <!-- mDateList will always be sorted before being set -->
       <field name="mDateList">null</field>
       <!-- array of { date: calIDatetime, column: colbox, header: hdrbox }  -->
       <field name="mDateColumns">null</field>
       <field name="mPixPerMin">0.6</field>
       <field name="mMinPixelsPerMinute">0.1</field>
       <field name="mSelectedDayCol">null</field>
       <field name="mSelectedDay">null</field>
-      <field name="mStartMin">0*60</field>
-      <field name="mEndMin">24*60</field>
+      <field name="mStartMin">0</field>
+      <field name="mEndMin">24 * 60</field>
       <field name="mDayStartMin">0</field>
       <field name="mDayEndMin">0</field>
-      <field name="mVisibleMinutes">9*60</field>
+      <field name="mVisibleMinutes">9 * 60</field>
       <field name="mClickedTime">null</field>
       <field name="mTimeIndicatorInterval">15</field>
       <field name="mModeHandler">null</field>
       <field name="mTimeIndicatorMinutes">0</field>
 
       <method name="flashAlarm">
         <parameter name="aAlarmItem"/>
         <parameter name="aStop"/>
@@ -3888,17 +3888,17 @@
         let scrollbox = document.getAnonymousElementByAttribute(this, "anonid", "scrollbox");
         let scrollBoxObject = scrollbox.boxObject;
         if (scrollBoxObject && scrollbox.scrollHeight > 0) {
             // We need to update the first visible minute, but only if the
             // scrollbox has been sized.
             let x = {}, y = {};
             scrollBoxObject.getPosition(x, y);
             if (scrollbox.getAttribute("orient") == "horizontal") {
-                this.mFirstVisibleMinute = Math.round(y.value/this.mPixPerMin);
+                this.mFirstVisibleMinute = Math.round(y.value / this.mPixPerMin);
             } else {
-                this.mFirstVisibleMinute = Math.round(x.value/this.mPixPerMin);
+                this.mFirstVisibleMinute = Math.round(x.value / this.mPixPerMin);
             }
         }
       ]]></handler>
     </handlers>
   </binding>
 </bindings>
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -188,17 +188,17 @@
           let ordinals = "";
           let visible = "";
           let sorted = this.mTreeView.selectedColumn;
           let tree = document.getAnonymousNodes(this)[0];
           let treecols = tree.getElementsByTagNameNS(tree.namespaceURI, "treecol");
           for (let i = 0; i < treecols.length; i++) {
               if (treecols[i].getAttribute("hidden") != "true") {
                 let content = treecols[i].getAttribute("itemproperty");
-                visible += (visible.length > 0) ? " "+content : content;
+                visible += (visible.length > 0) ? " " + content : content;
               }
               if (ordinals.length > 0) {
                   ordinals += " ";
               }
               ordinals += treecols[i].ordinal;
               if (widths.length > 0) {
                   widths += " ";
               }
@@ -1031,17 +1031,17 @@
 
           this.recreateHashTable();
         ]]></body>
       </method>
 
       <method name="recreateHashTable">
         <body><![CDATA[
           this.mHash2Index = {};
-          for (var i=0; i<this.mTaskArray.length; i++) {
+          for (var i=0; i < this.mTaskArray.length; i++) {
               var item = this.mTaskArray[i];
               this.mHash2Index[item.hashId] = i;
           }
           if (this.mTreeView.treebox) {
             this.mTreeView.treebox.invalidate();
           }
         ]]></body>
       </method>
@@ -1150,17 +1150,17 @@
 
         // let's build the drag region
         var region = null;
         try {
           region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
           region.init();
           var obo = tree.treeBoxObject;
           var bo = obo.treeBody.boxObject;
-          var sel= tree.view.selection;
+          var sel = tree.view.selection;
 
           var rowX = bo.x;
           var rowY = bo.y;
           var rowHeight = obo.rowHeight;
           var rowWidth = bo.width;
 
           // add a rectangle for each visible selected row
           for (var i = obo.getFirstVisibleRow(); i <= obo.getLastVisibleRow(); i++) {
--- a/calendar/base/content/calendar-ui-utils.js
+++ b/calendar/base/content/calendar-ui-utils.js
@@ -481,17 +481,17 @@ function updateMenuLabelsPlural(aLengthF
  * @throws              String error if value not found.
  */
 function menuListSelectItem(menuListId, value) {
     var menuList = document.getElementById(menuListId);
     var index = menuListIndexOf(menuList, value);
     if (index != -1) {
         menuList.selectedIndex = index;
     } else {
-        throw "menuListSelectItem: No such Element: "+value;
+        throw "menuListSelectItem: No such Element: " + value;
     }
 }
 
 /**
  * Find index of menuitem with the given value, or return -1 if not found.
  *
  * @param menuListId    The XUL menulist node to check.
  * @param value         The value to look for.
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -535,18 +535,17 @@ function updateLink() {
             // No protocol handler for the given protocol, or invalid uri
             hideOrShow(false);
             return;
         }
 
         // Only show if its either an internal protcol handler, or its external
         // and there is an external app for the scheme
         handler = cal.wrapInstance(handler, Components.interfaces.nsIExternalProtocolHandler);
-        hideOrShow(!handler||
-                   handler.externalAppExistsForScheme(uri.scheme));
+        hideOrShow(!handler || handler.externalAppExistsForScheme(uri.scheme));
 
         setTimeout(function() {
           // HACK the url-link doesn't crop when setting the value in onLoad
           setElementValue("url-link", itemUrlString);
           setElementValue("url-link", itemUrlString, "href");
         }, 0);
     }
 }
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
@@ -88,22 +88,22 @@ function onLoad() {
     // with plain xul and css, at least as far as i know.
     const kStylesheet = "chrome://calendar/skin/calendar-event-dialog.css";
     for (var stylesheet of document.styleSheets) {
         if (stylesheet.href == kStylesheet) {
             // make the dummy-spacer #1 [top] the same height as the timebar
             var timebar = document.getElementById("timebar");
             stylesheet.insertRule(
                 ".attendee-spacer-top { height: "
-                    + timebar.boxObject.height+"px; }", 0);
+                    + timebar.boxObject.height + "px; }", 0);
             // make the dummy-spacer #2 [bottom] the same height as the scrollbar
             var scrollbar = document.getElementById("horizontal-scrollbar");
             stylesheet.insertRule(
                 ".attendee-spacer-bottom { height: "
-                    + scrollbar.boxObject.height+"px; }", 0);
+                    + scrollbar.boxObject.height + "px; }", 0);
             break;
         }
     }
 
     // attach an observer to get notified of changes
     // that are relevant to this dialog.
     var prefObserver = {
         observe: function aD_observe(aSubject, aTopic, aPrefName) {
@@ -919,17 +919,17 @@ function onAttrModified(event) {
                 if (event.attrName == "curpos") {
                     let maxpos = scrollbar.getAttribute("maxpos");
                     attendees.ratio = event.newValue / maxpos;
                 }
                 grid.firstVisibleRow = attendees.firstVisibleRow;
             } else if (scrollbar.getAttribute("id") == "horizontal-scrollbar") {
                 if (event.attrName == "curpos") {
                     let maxpos = scrollbar.getAttribute("maxpos");
-                    let ratio = event.newValue/maxpos;
+                    let ratio = event.newValue / maxpos;
                     let timebar = document.getElementById("timebar");
                     let grid = document.getElementById("freebusy-grid");
                     let selectionbar = document.getElementById("selection-bar");
                     timebar.scroll = ratio;
                     grid.scroll = ratio;
                     selectionbar.ratio = ratio;
                 }
             }
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -608,17 +608,17 @@
                 if (mailingList) {
                     let entries = this._getListEntries(mailingList);
                       if (entries.length > 0) {
                           let currentIndex = parseInt(input.id.substr(13), 10);
                           let template = document.getAnonymousElementByAttribute(this, "anonid", "item");
                           let currentNode = template.parentNode.childNodes[currentIndex];
                           this._fillListItemWithEntry(currentNode, entries[0], currentIndex);
                           entries.shift();
-                          let nextNode = template.parentNode.childNodes[currentIndex+1];
+                          let nextNode = template.parentNode.childNodes[currentIndex + 1];
                           currentIndex++;
                           for (let entry of entries) {
                               currentNode = template.cloneNode(true);
                               template.parentNode.insertBefore(currentNode, nextNode);
                               this._fillListItemWithEntry(currentNode, entry, currentIndex);
                               currentIndex++;
                           }
                           this.mMaxAttendees += entries.length;
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -304,17 +304,17 @@ function onSave(item) {
             recRule.setComponent("BYDAY", onDays.length, onDays);
         }
         break;
     case 2:
         recRule.type = "MONTHLY";
         var monthInterval = Number(getElementValue("monthly-interval"));
         recRule.interval = monthInterval;
         var monthlyGroup = document.getElementById("monthly-group");
-        if (monthlyGroup.selectedIndex==0) {
+        if (monthlyGroup.selectedIndex == 0) {
             var ordinal = Number(getElementValue("monthly-ordinal"));
             var day_of_week = Number(getElementValue("monthly-weekday"));
             if (day_of_week < 0) {
                 if (ordinal == 0) {
                     // Monthly rule "Every day of the month".
                     recRule.setComponent("BYDAY", 7, ALL_WEEKDAYS);
                 } else {
                     // One of the first five days or the last day of the month.
--- a/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
@@ -67,17 +67,17 @@ function onLoad() {
  *
  * @param timezone      The calITimezone to look for.
  * @return              The index of the childnode below "timezone-menulist"
  */
 function findTimezone(timezone) {
     var tzid = timezone.tzid;
     var menulist = document.getElementById("timezone-menulist");
     var numChilds = menulist.childNodes[0].childNodes.length;
-    for (var i=0; i<numChilds; i++) {
+    for (var i = 0; i < numChilds; i++) {
         var menuitem = menulist.childNodes[0].childNodes[i];
         if (menuitem.getAttribute("value") == tzid) {
             return i;
         }
     }
     return -1;
 }
 
--- a/calendar/base/content/import-export.js
+++ b/calendar/base/content/import-export.js
@@ -47,17 +47,17 @@ function loadEventsFromFile(aCalendar) {
                                  .getService(Components.interfaces.calIImporter);
         } catch (e) {
             cal.WARN("Could not initialize importer: " + contractid + "\nError: " + e);
             continue;
         }
         let types = importer.getFileTypes({});
         for (let type of types) {
             fp.appendFilter(type.description, type.extensionFilter);
-            if (type.extensionFilter=="*." + fp.defaultExtension) {
+            if (type.extensionFilter == "*." + fp.defaultExtension) {
                 fp.filterIndex = currentListLength;
                 defaultCIDIndex = currentListLength;
             }
             contractids.push(contractid);
             currentListLength++;
         }
     }
 
@@ -87,17 +87,17 @@ function loadEventsFromFile(aCalendar) {
             inputStream.init( fp.file, MODE_RDONLY, parseInt("0444", 8), {});
             items = importer.importFromStream(inputStream, {});
         } catch(ex) {
             switch (ex.result) {
                 case Components.interfaces.calIErrors.INVALID_TIMEZONE:
                     showError(calGetString("calendar", "timezoneError", [filePath]));
                     break;
                 default:
-                    showError(calGetString("calendar", "unableToRead") + filePath + "\n"+ ex);
+                    showError(calGetString("calendar", "unableToRead") + filePath + "\n" + ex);
             }
         } finally {
             inputStream.close();
         }
 
         if (aCalendar) {
             putItemsIntoCal(aCalendar, items);
             return;
@@ -183,17 +183,17 @@ function putItemsIntoCal(destCal, aItems
             destCal.addItem(item, listener);
         } catch(e) {
             failedCount++;
             lastError = e;
             // Call the listener's operationComplete, to increase the
             // counter and not miss failed items. Otherwise, endBatch might
             // never be called.
             listener.onOperationComplete(null, null, null, null, null);
-            Components.utils.reportError("Import error: "+e);
+            Components.utils.reportError("Import error: " + e);
         }
     }
 
     // End transmgr batch
     endBatchTransaction();
 }
 
 /**
@@ -245,17 +245,17 @@ function saveEventsToFile(calendarEventA
                                  .getService(Components.interfaces.calIExporter);
         } catch (e) {
             cal.WARN("Could not initialize exporter: " + contractid + "\nError: " + e);
             continue;
         }
         let types = exporter.getFileTypes({});
         for (let type of types) {
             fp.appendFilter(type.description, type.extensionFilter);
-            if (type.extensionFilter=="*." + fp.defaultExtension) {
+            if (type.extensionFilter == "*." + fp.defaultExtension) {
                 fp.filterIndex = currentListLength;
                 defaultCIDIndex = currentListLength;
             }
             contractids.push(contractid);
             currentListLength++;
         }
     }
 
@@ -275,17 +275,17 @@ function saveEventsToFile(calendarEventA
             filterIndex = defaultCIDIndex;
         }
 
         let exporter = Components.classes[contractids[filterIndex]]
                                  .getService(Components.interfaces.calIExporter);
 
         let filePath = fp.file.path;
         if (!filePath.includes(".")) {
-            filePath += "."+exporter.getFileTypes({})[0].defaultExtension;
+            filePath += "." + exporter.getFileTypes({})[0].defaultExtension;
         }
 
         const nsILocalFile = Components.interfaces.nsILocalFile;
         const nsIFileOutputStream = Components.interfaces.nsIFileOutputStream;
 
         let outputStream;
         let localFileInstance = Components.classes["@mozilla.org/file/local;1"]
                                           .createInstance(nsILocalFile);
--- a/calendar/base/content/preferences/alarms.js
+++ b/calendar/base/content/preferences/alarms.js
@@ -124,13 +124,13 @@ var gAlarmsPane = {
         var alarmsPlaySoundPref =
             document.getElementById("calendar.alarms.playsound");
 
         var items = [document.getElementById("alarmSoundFileField"),
                      document.getElementById("calendar.prefs.alarm.sound.useDefault"),
                      document.getElementById("calendar.prefs.alarm.sound.browse"),
                      document.getElementById("calendar.prefs.alarm.sound.play")];
 
-        for (var i=0; i < items.length; i++) {
+        for (var i = 0; i < items.length; i++) {
             items[i].disabled = !alarmsPlaySoundPref.value;
         }
     }
 };
--- a/calendar/base/content/preferences/categories.js
+++ b/calendar/base/content/preferences/categories.js
@@ -75,27 +75,27 @@ var gCategoriesPane = {
         listbox.clearSelection();
         this.updateButtons();
 
 
         while (listbox.lastChild.id != "categoryColumns") {
             listbox.lastChild.remove();
         }
 
-        for (var i=0; i < gCategoryList.length; i++) {
+        for (var i = 0; i < gCategoryList.length; i++) {
             var newListItem = document.createElement("listitem");
             var categoryName = document.createElement("listcell");
             categoryName.setAttribute("id", gCategoryList[i]);
             categoryName.setAttribute("label", gCategoryList[i]);
             var categoryNameFix = formatStringForCSSRule(gCategoryList[i]);
             var categoryColor = document.createElement("listcell");
             try {
                 var colorCode = categoryPrefBranch.getCharPref(categoryNameFix);
                 categoryColor.setAttribute("id", colorCode);
-                categoryColor.setAttribute("style", "background-color: "+colorCode+';');
+                categoryColor.setAttribute("style", "background-color: " + colorCode + ";");
             } catch (ex) {
                 categoryColor.setAttribute("label", noneLabel);
             }
 
             newListItem.appendChild(categoryName);
             newListItem.appendChild(categoryColor);
             listbox.appendChild(newListItem);
         }
@@ -184,17 +184,17 @@ var gCategoriesPane = {
      *
      * @param categoryName      The name of the category.
      * @param categoryColor     The color of the category
      */
     saveCategory: function gCP_saveCateogry(categoryName, categoryColor) {
         var list = document.getElementById("categorieslist");
         // Check to make sure another category doesn't have the same name
         var toBeDeleted = -1;
-        for (var i=0; i < gCategoryList.length; i++) {
+        for (var i = 0; i < gCategoryList.length; i++) {
             if (i == list.selectedIndex) {
                 continue;
             }
 
             if (categoryName.toLowerCase() == gCategoryList[i].toLowerCase()) {
                 if (Services.prompt.confirm(null, overwriteTitle, overwrite)) {
                     if (list.selectedIndex != -1) {
                         // Don't delete the old category yet. It will mess up indices.
@@ -265,17 +265,17 @@ var gCategoriesPane = {
         var currentColor;
         try {
             currentColor = categoryPrefBranch.getCharPref(categoryNameFix);
         } catch (ex) {
             dump("Exception caught in 'backupData': " + ex + "\n");
             currentColor = "##NEW";
         }
 
-        for (var i=0; i < parent.backupPrefList.length; i++) {
+        for (var i = 0; i < parent.backupPrefList.length; i++) {
             if (categoryNameFix == parent.backupPrefList[i].name) {
                 return;
             }
         }
         parent.backupPrefList[parent.backupPrefList.length] =
             { name: categoryNameFix, color: currentColor };
     },
 
@@ -290,17 +290,17 @@ var gCategoriesPane = {
             this.editCategory();
         }
     },
 
     /**
      * Reverts category preferences in case the cancel button is pressed.
      */
     panelOnCancel: function gCP_panelOnCancel() {
-        for (var i=0; i < parent.backupPrefList.length; i++) {
+        for (var i = 0; i < parent.backupPrefList.length; i++) {
             if (parent.backupPrefList[i].color == "##NEW") {
                 try {
                    categoryPrefBranch.clearUserPref(parent.backupPrefList[i].name);
                 } catch (ex) {
                     dump("Exception caught in 'panelOnCancel': " + ex + "\n");
                 }
             } else {
                 categoryPrefBranch.setCharPref(parent.backupPrefList[i].name,
--- a/calendar/base/content/today-pane.js
+++ b/calendar/base/content/today-pane.js
@@ -89,18 +89,18 @@ var TodayPane = {
     /**
      * Sets up the miniday display in the today pane.
      */
     initializeMiniday: function initializeMiniday() {
         // initialize the label denoting the current month, year and calendarweek
         // with numbers that are supposed to consume the largest width
         // in order to guarantee that the text will not be cropped when modified
         // during runtime
-        const kYEARINIT= "5555";
-        const kCALWEEKINIT= "55";
+        const kYEARINIT = "5555";
+        const kCALWEEKINIT = "55";
         let monthdisplaydeck = document.getElementById("monthNameContainer");
         let childNodes = monthdisplaydeck.childNodes;
 
         for (let i = 0; i < childNodes.length; i++) {
             let monthlabel = childNodes[i];
             this.setMonthDescription(monthlabel, i, kYEARINIT, kCALWEEKINIT);
         }
 
@@ -166,35 +166,35 @@ var TodayPane = {
      *
      * NOTE: This function is usually called without the correct this pointer.
      */
     onMousemove: function md_onMousemove(aEvent) {
         const MIN_DRAG_DISTANCE_SQ = 49;
         let x = aEvent.clientX - TodayPane.minidayDrag.startX;
         let y = aEvent.clientY - TodayPane.minidayDrag.startY;
         if (TodayPane.minidayDrag.session) {
-            if (x*x + y*y >= MIN_DRAG_DISTANCE_SQ) {
-                let distance = Math.floor(Math.sqrt(x*x + y*y) - Math.sqrt(MIN_DRAG_DISTANCE_SQ));
+            if (x * x + y * y >= MIN_DRAG_DISTANCE_SQ) {
+                let distance = Math.floor(Math.sqrt(x * x + y * y) - Math.sqrt(MIN_DRAG_DISTANCE_SQ));
                 // Dragging on the left/right side, the day date decrease/increase
                 TodayPane.minidayDrag.distance = (x > 0) ? distance : -distance;
             } else {
                 TodayPane.minidayDrag.distance = 0;
             }
         } else {
             // move the mouse a bit before starting the drag session
-            if (x*x + y*y > 9) {
+            if (x * x + y * y > 9) {
                 window.addEventListener("mouseout", TodayPane.stopSwitching, false);
                 TodayPane.minidayDrag.session = true;
                 let dragCenterImage = document.getElementById("dragCenter-image");
                 dragCenterImage.removeAttribute("hidden");
                 // Move the starting point in the center so we have a fixed
                 // point where stopping the day switching while still dragging
                 let centerObj = dragCenterImage.boxObject;
-                TodayPane.minidayDrag.startX = Math.floor(centerObj.x + centerObj.width/2);
-                TodayPane.minidayDrag.startY = Math.floor(centerObj.y + centerObj.height/2);
+                TodayPane.minidayDrag.startX = Math.floor(centerObj.x + centerObj.width / 2);
+                TodayPane.minidayDrag.startY = Math.floor(centerObj.y + centerObj.height / 2);
 
                 TodayPane.updateAdvanceTimer();
             }
         }
     },
 
     /**
      * Figure out the days switching speed according to the position (when
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -952,17 +952,17 @@
       <method name="cycleCell">
         <parameter name="aRow"/>
         <parameter name="aCol"/>
         <body><![CDATA[
           let calendar = this.getCalendar(aRow);
           if (this.mCycleCalendarFlag[calendar.id]) {
               delete this.mCycleCalendarFlag[calendar.id];
           } else {
-              this.mCycleCalendarFlag[calendar.id]=calendar;
+              this.mCycleCalendarFlag[calendar.id] = calendar;
           }
 
           if (this.mCycleTimer) {
               clearTimeout(this.mCycleTimer);
           }
           this.treebox.invalidateRow(aRow);
           this.mCycleTimer = setTimeout(this.cycleCellCommit.bind(this), 200);
         ]]></body>
--- a/calendar/base/content/widgets/calendar-widgets.xml
+++ b/calendar/base/content/widgets/calendar-widgets.xml
@@ -406,17 +406,17 @@
                         if (this.getAttribute("collapsedinmodes") == ",") {
                             collapsedModes.splice(0, 2);
                         }
                     }
                 } else {
                     if (modeIndex > -1) {
                         collapsedModes.splice(modeIndex, 1);
                         if (collapsedModes.join(",") == "") {
-                            collapsedModes[0]=",";
+                            collapsedModes[0] = ",";
                         }
                     }
                 }
                 this.setAttribute("collapsedinmodes", collapsedModes.join(","));
                 var id = this.getAttribute("id");
                 if (id) {
                     document.persist(id, "collapsedinmodes");
                 }
--- a/calendar/base/content/widgets/minimonth.xml
+++ b/calendar/base/content/widgets/minimonth.xml
@@ -1110,17 +1110,17 @@
          ]]></body>
       </method>
 
       <method name="_getStartDate">
         <parameter name="aMainDate"/>
         <body><![CDATA[
           var date = new Date(aMainDate);
           var firstWeekday = (7 + aMainDate.getDay() - this.weekStart) % 7;
-          date.setDate(date.getDate()-firstWeekday);
+          date.setDate(date.getDate() - firstWeekday);
           return date;
         ]]></body>
       </method>
 
       <method name="_getEndDate">
         <parameter name="aMainDate"/>
         <body><![CDATA[
           var date = this._getStartDate(aMainDate);
--- a/calendar/base/modules/calAuthUtils.jsm
+++ b/calendar/base/modules/calAuthUtils.jsm
@@ -181,26 +181,27 @@ cal.auth.Prompt.prototype = {
 
         let logins = Services.logins.findLogins({}, aPasswordRealm.prePath, null, aPasswordRealm.realm);
         if (logins.length) {
             username = logins[0].username;
             password = logins[0].password;
             found = true;
         }
         if (found) {
-            let keyStr = aPasswordRealm.prePath +":" + aPasswordRealm.realm;
+            let keyStr = aPasswordRealm.prePath + ":" + aPasswordRealm.realm;
             let now = new Date();
             // Remove the saved password if it was already returned less
             // than 60 seconds ago. The reason for the timestamp check is that
             // nsIHttpChannel can call the nsIAuthPrompt2 interface
             // again in some situation. ie: When using Digest auth token
             // expires.
             if (this.mReturnedLogins[keyStr] &&
                 now.getTime() - this.mReturnedLogins[keyStr].getTime() < 60000) {
-                cal.LOG("Credentials removed for: user=" + username + ", host="+aPasswordRealm.prePath+", realm="+aPasswordRealm.realm);
+                cal.LOG("Credentials removed for: user=" + username + ", host=" + aPasswordRealm.prePath + ", realm=" + aPasswordRealm.realm)
+;
                 delete this.mReturnedLogins[keyStr];
                 cal.auth.passwordManagerRemove(username,
                                                aPasswordRealm.prePath,
                                                aPasswordRealm.realm);
                 return {found: false, username: username};
             }
             else {
                 this.mReturnedLogins[keyStr] = now;
@@ -279,17 +280,17 @@ cal.auth.Prompt.prototype = {
                                      aCallback,  // nsIAuthPromptCallback
                                      aContext,   // nsISupports
                                      aLevel,     // PRUint32
                                      aAuthInfo   // nsIAuthInformation
                                 ) {
         var self = this;
         let promptlistener = {
             onPromptStart: function() {
-                res=self.promptAuth(aChannel, aLevel, aAuthInfo);
+                res = self.promptAuth(aChannel, aLevel, aAuthInfo);
 
                 if (res) {
                     gAuthCache.setAuthInfo(hostKey, aAuthInfo);
                     this.onPromptAuthAvailable();
                     return true;
                 }
 
                 this.onPromptCanceled();
--- a/calendar/base/modules/calExtract.jsm
+++ b/calendar/base/modules/calExtract.jsm
@@ -102,17 +102,17 @@ Extractor.prototype = {
         for (let i = 0; i < this.email.length; i++) {
             let ch = this.email.charCodeAt(i);
             if (ch > 128) {
                 sum += ch;
                 cnt++;
             }
         }
 
-        let nonAscii = sum/cnt || 0;
+        let nonAscii = sum / cnt || 0;
         cal.LOG("[calExtract] Average non-ascii charcode: " + nonAscii);
         return nonAscii;
     },
 
     setLanguage: function setLanguage() {
         let path;
 
         if (this.fixedLang == true) {
@@ -192,17 +192,17 @@ Extractor.prototype = {
                     if (words[word].length >= 2) {
                         total++;
                         if (sp.check(words[word])) {
                             correct++;
                         }
                     }
                 }
 
-                let percentage = correct/total * 100.0;
+                let percentage = correct / total * 100.0;
                 cal.LOG("[calExtract] " + dicts[dict] + " dictionary matches " +
                         percentage + "% of words");
 
                 if (percentage > 50.0 && percentage > most) {
                     mostLocale = patterns;
                     most = percentage;
                 }
             }
--- a/calendar/base/modules/calProviderUtils.jsm
+++ b/calendar/base/modules/calProviderUtils.jsm
@@ -319,17 +319,17 @@ cal.fromRFC3339 = function fromRFC3339(a
 
     var matches = re.exec(aStr);
 
     if (!matches) {
         return null;
     }
 
     // Set usual date components
-    dateTime.isDate = (matches[4]==null);
+    dateTime.isDate = (matches[4] == null);
 
     dateTime.year = matches[1];
     dateTime.month = matches[2] - 1; // Jan is 0
     dateTime.day = matches[3];
 
     if (!dateTime.isDate) {
         dateTime.hour = matches[5];
         dateTime.minute = matches[6];
--- a/calendar/base/modules/calRecurrenceUtils.jsm
+++ b/calendar/base/modules/calRecurrenceUtils.jsm
@@ -104,18 +104,18 @@ function recurrenceRule2String(recurrenc
                         if (days.length > 1 && i == (days.length - 2)) {
                             weekdays += ' ' + getRString("repeatDetailsAnd") + ' ';
                         } else if (i < days.length - 1) {
                             weekdays += ', ';
                         }
                     }
 
                     weeklyString = getRString(weeklyString, [weekdays]);
-                    ruleString= PluralForm.get(rule.interval, weeklyString)
-                                          .replace("#2", rule.interval);
+                    ruleString = PluralForm.get(rule.interval, weeklyString)
+                                           .replace("#2", rule.interval);
 
                 } else {
                     let weeklyString = getRString("weeklyEveryNth");
                     ruleString = PluralForm.get(rule.interval, weeklyString)
                                            .replace("#1", rule.interval);
                 }
             } else if (rule.type == 'MONTHLY') {
                 if (checkRecurrenceRule(rule, ['BYDAY'])) {
--- a/calendar/base/src/calCachedCalendar.js
+++ b/calendar/base/src/calCachedCalendar.js
@@ -320,17 +320,17 @@ calCachedCalendar.prototype = {
         if (this.supportsChangeLog) {
             cal.LOG("[calCachedCalendar] Doing changelog based sync for calendar " + this.uri.spec);
             var opListener = {
                 onResult: function(op, result) {
                     if (!op || !op.isPending) {
                         var status = (op ? op.status : Components.results.NS_OK);
                         if (!Components.isSuccessCode(status)) {
                             cal.ERROR("[calCachedCalendar] replay action failed: " +
-                                      (op ? op.id : "<unknown>")+", uri=" +
+                                      (op ? op.id : "<unknown>") + ", uri=" +
                                       this_.uri.spec + ", result=" +
                                       result + ", op=" + op);
                         }
                         cal.LOG("[calCachedCalendar] replayChangesOn finished.");
                         emptyQueue(status);
                     }
                 }
             };
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -925,17 +925,17 @@ calMgrCalendarObserver.prototype = {
             errMsg = props.formatStringFromName("minorError", [this.calendar.name], 1);
         } else {
             // The calendar was already in readOnly mode, but still tell the user
             errMsg = props.formatStringFromName("stillReadOnlyError", [this.calendar.name], 1);
         }
 
         // When possible, change the error number into its name, to
         // make it slightly more readable.
-        var errCode = "0x"+aErrNo.toString(16);
+        var errCode = "0x" + aErrNo.toString(16);
         const calIErrors = Components.interfaces.calIErrors;
         // Check if it is worth enumerating all the error codes.
         if (aErrNo & calIErrors.ERROR_BASE) {
             for (var err in calIErrors) {
                 if (calIErrors[err] == aErrNo) {
                     errCode = err;
                 }
             }
--- a/calendar/base/src/calIcsParser.js
+++ b/calendar/base/src/calIcsParser.js
@@ -154,17 +154,17 @@ calIcsParser.prototype = {
 
         // Some other apps (most notably, sunbird 0.2) happily splits an UTF8
         // character between the octets, and adds a newline and space between them,
         // for ICS folding. Unfold manually before parsing the file as utf8.This is
         // UTF8 safe, because octets with the first bit 0 are always one-octet
         // characters. So the space or the newline never can be part of a multi-byte
         // char.
         for (let i = octetArray.length - 2; i >= 0; i--) {
-            if (octetArray[i] == "\n" && octetArray[i+1] == " ") {
+            if (octetArray[i] == "\n" && octetArray[i + 1] == " ") {
                 octetArray = octetArray.splice(i, 2);
             }
         }
 
         // Interpret the byte-array as a UTF8-string, and convert into a
         // javascript string.
         let unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
                                          .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
--- a/calendar/base/src/calRecurrenceInfo.js
+++ b/calendar/base/src/calRecurrenceInfo.js
@@ -551,17 +551,17 @@ calRecurrenceInfo.prototype = {
                     // As decided in bug 734245, an EXDATE of type DATE shall also match a DTSTART of type DATE-TIME
                     let toRemove = [];
                     for (let occurenceKey in occurrenceMap) {
                         if (occurrenceMap[occurenceKey] && occurenceKey.substring(0, 8) == dateToRemoveKey) {
                             dates = dates.filter(function (d) { return d.id.compare(dateToRemove) != 0; });
                             toRemove.push(occurenceKey)
                         }
                     }
-                    for (let i=0; i < toRemove.length; i++) {
+                    for (let i = 0; i < toRemove.length; i++) {
                         delete occurrenceMap[toRemove[i]];
                     }
                 } else if (occurrenceMap[dateToRemoveKey]) {
                     // TODO PERF Theoretically we could use occurrence map
                     // to construct the array of occurrences. Right now I'm
                     // just using the occurrence map to skip the filter
                     // action if the occurrence isn't there anyway.
                     dates = dates.filter(function (d) { return d.id.compare(dateToRemove) != 0; });
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -308,17 +308,17 @@ function guessSystemTimezone() {
     const offsetRegex = /[+-]\d{4}/;
     const offsetJun = dateJun.match(offsetRegex)[0];
     const offsetDec = dateDec.match(offsetRegex)[0];
 
     const tzSvc = cal.getTimezoneService();
 
     var continent = "Africa|America|Antarctica|Asia|Australia|Europe";
     var ocean = "Arctic|Atlantic|Indian|Pacific";
-    var tzRegex = new RegExp(".*((?:"+continent+"|"+ocean+")"+
+    var tzRegex = new RegExp(".*((?:" + continent + "|" + ocean + ")" +
                              "(?:[/][-A-Z_a-z]+)+)");
 
     function getIcalString(component, property) {
         var prop = (component && component.getFirstProperty(property));
         return (prop ? prop.valueAsIcalString : null);
     }
 
     // Check if Olson ZoneInfo timezone matches OS/JSDate timezone properties:
@@ -415,34 +415,34 @@ function guessSystemTimezone() {
         const afterAutumnShiftJSDate = new Date(autumnShiftJSDate);
         const beforeAutumnShiftJSDate = new Date(autumnShiftJSDate);
         const springShiftJSDate =
             findCurrentTimePeriod(tz, subComp, "DAYLIGHT", true);
         const beforeSpringShiftJSDate = new Date(springShiftJSDate);
         const afterSpringShiftJSDate = new Date(springShiftJSDate);
         // Try with 6 HOURS fuzz in either direction, since OS and ZoneInfo
         // may disagree on the exact time of shift (midnight, 2am, 4am, etc).
-        beforeAutumnShiftJSDate.setHours(autumnShiftJSDate.getHours()-6);
-        afterAutumnShiftJSDate.setHours(autumnShiftJSDate.getHours()+6);
-        afterSpringShiftJSDate.setHours(afterSpringShiftJSDate.getHours()+6);
-        beforeSpringShiftJSDate.setHours(beforeSpringShiftJSDate.getHours()-6);
+        beforeAutumnShiftJSDate.setHours(autumnShiftJSDate.getHours() - 6);
+        afterAutumnShiftJSDate.setHours(autumnShiftJSDate.getHours() + 6);
+        afterSpringShiftJSDate.setHours(afterSpringShiftJSDate.getHours() + 6);
+        beforeSpringShiftJSDate.setHours(beforeSpringShiftJSDate.getHours() - 6);
         if ((beforeAutumnShiftJSDate.getTimezoneOffset() <
              afterAutumnShiftJSDate.getTimezoneOffset()) &&
             (beforeSpringShiftJSDate.getTimezoneOffset() >
              afterSpringShiftJSDate.getTimezoneOffset())) {
             return 2;
         }
         // Try with 7 DAYS fuzz in either direction, so if no other tz found,
         // will have a nearby tz that disagrees only on the weekday of shift
         // (sunday vs. friday vs. calendar day), or off by exactly one week,
         // (e.g., needed to guess Africa/Cairo on w2k in 2006).
-        beforeAutumnShiftJSDate.setDate(autumnShiftJSDate.getDate()-7);
-        afterAutumnShiftJSDate.setDate(autumnShiftJSDate.getDate()+7);
-        afterSpringShiftJSDate.setDate(afterSpringShiftJSDate.getDate()+7);
-        beforeSpringShiftJSDate.setDate(beforeSpringShiftJSDate.getDate()-7);
+        beforeAutumnShiftJSDate.setDate(autumnShiftJSDate.getDate() - 7);
+        afterAutumnShiftJSDate.setDate(autumnShiftJSDate.getDate() + 7);
+        afterSpringShiftJSDate.setDate(afterSpringShiftJSDate.getDate() + 7);
+        beforeSpringShiftJSDate.setDate(beforeSpringShiftJSDate.getDate() - 7);
         if ((beforeAutumnShiftJSDate.getTimezoneOffset() <
              afterAutumnShiftJSDate.getTimezoneOffset()) &&
             (beforeSpringShiftJSDate.getTimezoneOffset() >
              afterSpringShiftJSDate.getTimezoneOffset())) {
             return 1;
         }
         // no match
         return 0;
@@ -510,32 +510,32 @@ function guessSystemTimezone() {
 
     function environmentVariableValue(varName) {
         let envSvc = Components.classes["@mozilla.org/process/environment;1"]
                                 .getService(Components.interfaces.nsIEnvironment);
         let value = envSvc.get(varName);
         if (!value || !value.match(tzRegex)) {
             return "";
         }
-        return varName+"="+value;
+        return varName + "=" + value;
     }
 
     function symbolicLinkTarget(filepath) {
         try {
             let file = Components.classes["@mozilla.org/file/local;1"]
                                  .createInstance(Components.interfaces.nsILocalFile);
             file.initWithPath(filepath);
             file.QueryInterface(Components.interfaces.nsIFile);
             if (!file.exists() || !file.isSymlink() || !file.target.match(tzRegex)) {
                 return "";
             }
 
-            return filepath +" -> "+file.target;
+            return filepath + " -> " + file.target;
         } catch (ex) {
-            Components.utils.reportError(filepath+": "+ex);
+            Components.utils.reportError(filepath + ": " + ex);
             return "";
         }
     }
 
     function fileFirstZoneLineString(filepath) {
         // return first line of file that matches tzRegex (ZoneInfo id),
         // or "" if no file or no matching line.
         try {
@@ -551,25 +551,25 @@ function guessSystemTimezone() {
             const PR_RDONLY = 0x1;
             fileInstream.init(file, PR_RDONLY, 0, 0);
             fileInstream.QueryInterface(Components.interfaces.nsILineInputStream);
             try {
                 let line = {}, hasMore = true, MAXLINES = 10;
                 for (let i = 0; hasMore && i < MAXLINES; i++) {
                     hasMore = fileInstream.readLine(line);
                     if (line.value && line.value.match(tzRegex)) {
-                        return filepath+": "+line.value;
+                        return filepath + ": " + line.value;
                     }
                 }
                 return ""; // not found
             } finally {
                 fileInstream.close();
             }
         } catch (ex) {
-            Components.utils.reportError(filepath+": "+ex);
+            Components.utils.reportError(filepath + ": " + ex);
             return "";
         }
     }
 
     function weekday(icsDate, tz) {
         let calDate = cal.createDateTime(icsDate);
         calDate.timezone = tz;
         return cal.dateTimeToJsDate(calDate).toLocaleFormat("%a");
@@ -724,17 +724,17 @@ function guessSystemTimezone() {
                     }
                     break;
                 case 3:
                     return tzId;
                 }
             } catch (ex) {
                 let errMsg = calProperties.formatStringFromName(
                     "SkippingLocaleTimezone", [bareTZId], 1);
-                Components.utils.reportError(errMsg+" "+ex);
+                Components.utils.reportError(errMsg + " " + ex);
             }
         }
     } catch (ex) { // Oh well, this didn't work, next option...
         Components.utils.reportError(ex);
     }
 
     // Third, try all known timezones.
     const tzIDs = tzSvc.timezoneIds;
@@ -777,34 +777,34 @@ function guessSystemTimezone() {
             var warningDetail;
             if (probableTZScore == 1) {
                 // score 1 means has daylight time,
                 // but transitions start on different weekday from os timezone.
                 var standardStart = getIcalString(standard, "DTSTART");
                 var standardStartWeekday = weekday(standardStart, tz);
                 var standardRule = getIcalString(standard, "RRULE");
                 var standardText =
-                    ("  Standard: "+standardStart+" "+standardStartWeekday+"\n"+
-                     "            "+standardRule+"\n");
+                    ("  Standard: " + standardStart + " " + standardStartWeekday + "\n" +
+                     "            " + standardRule + "\n");
                 var daylightStart = getIcalString(daylight, "DTSTART");
                 var daylightStartWeekday = weekday(daylightStart, tz);
                 var daylightRule = getIcalString(daylight, "RRULE");
                 var daylightText =
-                    ("  Daylight: "+daylightStart+" "+daylightStartWeekday+"\n"+
-                     "            "+daylightRule+"\n");
+                    ("  Daylight: " + daylightStart + " " + daylightStartWeekday + "\n" +
+                     "            " + daylightRule + "\n");
                 warningDetail =
                     ((standardStart < daylightStart
                       ? standardText + daylightText
-                      : daylightText + standardText)+
+                      : daylightText + standardText) +
                      (calProperties.GetStringFromName(
                       "TZAlmostMatchesOSDifferAtMostAWeek")));
             } else {
                 warningDetail = calProperties.GetStringFromName("TZSeemsToMatchOS");
             }
-            var offsetString = standardTZOffset+
+            var offsetString = standardTZOffset +
                                  (!daylightTZOffset ? "" : "/" + daylightTZOffset);
             var warningMsg = calProperties.formatStringFromName("WarningUsingGuessedTZ",
                               [tzId, offsetString, warningDetail, probableTZSource], 4);
             cal.WARN(warningMsg);
             break;
         }
     } catch (ex) { // don't abort if error occurs warning user
         Components.utils.reportError(ex);
--- a/calendar/base/src/calWeekInfoService.js
+++ b/calendar/base/src/calWeekInfoService.js
@@ -76,17 +76,17 @@ calWeekInfoService.prototype = {
             var lastYearDate = aDateTime.clone();
             lastYearDate.year -= 1;
             thisWeeksThursday += lastYearDate.endOfYear.yearday;
         } else if (thisWeeksThursday > aDateTime.endOfYear.yearday) {
             // For the last few days of the year, we already are in week 1.
             thisWeeksThursday -= aDateTime.endOfYear.yearday;
         }
 
-        var weekNumber = Math.ceil(thisWeeksThursday/7);
+        var weekNumber = Math.ceil(thisWeeksThursday / 7);
         return weekNumber;
     },
 
     /**
      * gets the first day of a week of a passed day under consideration
      * of the preference setting "calendar.week.start"
      *
      * @param aDate     a date time object
--- a/calendar/import-export/calOutlookCSVImportExport.js
+++ b/calendar/import-export/calOutlookCSVImportExport.js
@@ -150,17 +150,17 @@ calOutlookCSVImporter.prototype = {
         let i;
         let knownIndxs;
         for (i in locales) {
             locale = locales[i];
             knownIndxs = 0;
             args.titleIndex = 0;
             args.startDateIndex = 0;
             for (let i = 1; i <= header.length; ++i) {
-                switch( header[i-1] ) {
+                switch (header[i - 1]) {
                     case locale.headTitle: args.titleIndex = i; knownIndxs++; break;
                     case locale.headStartDate: args.startDateIndex = i; knownIndxs++; break;
                     case locale.headStartTime: args.startTimeIndex = i; knownIndxs++; break;
                     case locale.headEndDate: args.endDateIndex = i; knownIndxs++; break;
                     case locale.headEndTime: args.endTimeIndex = i; knownIndxs++; break;
                     case locale.headAllDayEvent: args.allDayIndex = i; knownIndxs++; break;
                     case locale.headAlarm: args.alarmIndex = i; knownIndxs++; break;
                     case locale.headAlarmDate: args.alarmDateIndex = i; knownIndxs++; break;
@@ -481,19 +481,19 @@ calOutlookCSVExporter.prototype = {
                 alarmDate = cal.alarms.calculateAlarmDate(item, alarms[0]);
             }
             line.push(alarmDate ? localeEn.valueTrue : localeEn.valueFalse);
             line.push(alarmDate ? dateString(alarmDate) : "");
             line.push(alarmDate ? timeString(alarmDate) : "");
             line.push(txtString(cal.categoriesArrayToString(item.getCategories({})))); // xxx todo: what's the correct way to encode ',' in csv?, how are multi-values expressed?
             line.push(txtString(item.getProperty("DESCRIPTION")));
             line.push(txtString(item.getProperty("LOCATION")));
-            line.push((item.privacy=="PRIVATE") ? localeEn.valueTrue : localeEn.valueFalse);
+            line.push((item.privacy == "PRIVATE") ? localeEn.valueTrue : localeEn.valueFalse);
 
             line = line.map(function(v) {
                 v = String(v).replace(/"/g, '""');
-                return '"'+v+'"';
+                return '"' + v + '"';
             })
             str = line.join(',') + exportLineEnding;
             aStream.write(str, str.length);
         }
     }
 };
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -433,29 +433,29 @@ calDavCalendar.prototype = {
 
     get calendarUri() {
         let calUri = this.mUri.clone();
         let parts = calUri.spec.split('?');
         if (parts.length > 1) {
             calUri.spec = parts.shift();
             this.mUriParams = '?' + parts.join('?');
         }
-        if (calUri.spec.charAt(calUri.spec.length-1) != '/') {
+        if (calUri.spec.charAt(calUri.spec.length - 1) != '/') {
             calUri.spec += "/";
         }
         return calUri;
     },
 
     setCalHomeSet: function caldav_setCalHomeSet(removeLastPathSegment) {
         if (removeLastPathSegment) {
             let calUri = this.mUri.clone();
             let split1 = calUri.spec.split('?');
             let baseUrl = split1[0];
-            if (baseUrl.charAt(baseUrl.length-1) == '/') {
-                baseUrl = baseUrl.substring(0, baseUrl.length-2);
+            if (baseUrl.charAt(baseUrl.length - 1) == '/') {
+                baseUrl = baseUrl.substring(0, baseUrl.length - 2);
             }
             let split2 = baseUrl.split('/');
             split2.pop();
             calUri.spec = split2.join('/') + '/';
             this.mCalHomeSet = calUri;
         } else {
             this.mCalHomeSet = this.calendarUri;
         }
@@ -1178,18 +1178,18 @@ calDavCalendar.prototype = {
      * notifying the observers and listeners
      *
      * @param aChangeLogListener    Change log listener
      * @param calendarURI           URI of the calendar whose items just got
      *                              changed
      */
     finalizeUpdatedItems: function calDav_finalizeUpdatedItems(aChangeLogListener, calendarURI) {
         cal.LOG("aChangeLogListener=" + aChangeLogListener + "\n" +
-                "calendarURI=" + (calendarURI?calendarURI.spec:"undefined") + " \n" +
-                "iscached=" + this.isCached + "\n"+
+                "calendarURI=" + (calendarURI ? calendarURI.spec : "undefined") + " \n" +
+                "iscached=" + this.isCached + "\n" +
                 "this.mQueuedQueries.length=" + this.mQueuedQueries.length);
         if (this.isCached) {
             if (aChangeLogListener) {
                 aChangeLogListener.onResult({ status: Components.results.NS_OK },
                                             Components.results.NS_OK);
             }
         } else {
             this.mObservers.notify("onLoad", [this]);
--- a/calendar/providers/caldav/calDavRequestHandlers.js
+++ b/calendar/providers/caldav/calDavRequestHandlers.js
@@ -501,20 +501,20 @@ webDavSyncHandler.prototype = {
 
     },
 
     startElement: function wH_startElement(aUri, aLocalName, aQName, aAttributes) {
         switch (aLocalName) {
             case "response": // WebDAV Sync draft 3
                 this.currentResponse = {};
                 this.tag = null
-                this.isInPropStat=false;
+                this.isInPropStat = false;
                 break;
             case "propstat":
-                this.isInPropStat=true;
+                this.isInPropStat = true;
                 break;
             case "status":
                 if (this.isInPropStat) {
                     this.tag = "propstat_" + aLocalName;
                 }
                 else {
                     this.tag = aLocalName;
                 }
@@ -617,17 +617,17 @@ webDavSyncHandler.prototype = {
                 } else {
                     cal.LOG("CalDAV: Unhandled response element, status: " + r.status + ", href: " + r.href + " contenttype:" + r.getcontenttype);
                 }
                 break;
             case "sync-token":
                 this.newSyncToken = this.currentResponse[this.tag];
                 break;
             case "propstat":
-                this.isInPropStat=false;
+                this.isInPropStat = false;
                 break;
         }
         this.tag = null;
         if (this.calendar.verboseLogging()) {
             this.logXML += "</" + aQName + ">";
         }
     },
 
@@ -859,20 +859,20 @@ multigetSyncHandler.prototype = {
         }
     },
 
     startElement: function mg_startElement(aUri, aLocalName, aQName, aAttributes) {
         switch (aLocalName) {
             case "response":
                 this.currentResponse = {};
                 this.tag = null
-                this.isInPropStat=false;
+                this.isInPropStat = false;
                 break;
             case "propstat":
-                this.isInPropStat=true;
+                this.isInPropStat = true;
                 break;
             case "status":
                 if (this.isInPropStat) {
                     this.tag = "propstat_" + aLocalName;
                 }
                 else {
                     this.tag = aLocalName;
                 }
@@ -932,17 +932,17 @@ multigetSyncHandler.prototype = {
                     }
                 } else {
                     cal.WARN("CalDAV: Unexpected response, status: " +
                              r.status + ", href: " + r.href + " calendar-data:\n" + r.calendardata);
                     this.unhandledErrors++;
                 }
                 break;
             case "propstat":
-                this.isInPropStat=false;
+                this.isInPropStat = false;
                 break;
         }
         this.tag = null;
         if (this.calendar.verboseLogging()) {
             this.logXML += "</" + aQName + ">";
         }
     },
 
--- a/calendar/providers/ics/calICSCalendar.js
+++ b/calendar/providers/ics/calICSCalendar.js
@@ -276,17 +276,17 @@ calICSCalendar.prototype = {
                 try {
                     for (let item of parser_.getItems({})) {
                         this_.mMemoryCalendar.adoptItem(item, null);
                     }
                     this_.unmappedComponents = parser_.getComponents({});
                     this_.unmappedProperties = parser_.getProperties({});
                     cal.LOG("[calICSCalendar] Parsing ICS succeeded for " + this_.uri.spec);
                 } catch (exc) {
-                    cal.LOG("[calICSCalendar] Parsing ICS failed for " + "\nException: "+ exc);
+                    cal.LOG("[calICSCalendar] Parsing ICS failed for \nException: " + exc);
                     this_.mObserver.onError(this_.superCalendar, exc.result, exc.toString());
                     this_.mObserver.onError(this_.superCalendar, calIErrors.READ_FAILED, "");
                 }
                 this_.mObserver.onEndBatch();
                 this_.mObserver.onLoad(this_);
 
                 // Now that all items have been stuffed into the memory calendar
                 // we should add ourselves as observer. It is important that this
@@ -437,17 +437,17 @@ calICSCalendar.prototype = {
 
         if ((httpChannel && !requestSucceeded) ||
             (!httpChannel && !Components.isSuccessCode(request.status))) {
             ctxt.mObserver.onError(this.superCalendar,
                                    Components.isSuccessCode(request.status)
                                    ? calIErrors.DAV_PUT_ERROR
                                    : request.status,
                                    "Publishing the calendar file failed\n" +
-                                       "Status code: "+request.status.toString(16)+"\n");
+                                       "Status code: " + request.status.toString(16) + "\n");
             ctxt.mObserver.onError(this.superCalendar, calIErrors.MODIFICATION_FAILED, "");
 
             // the PUT has failed, refresh, and signal error to all modifying operations:
             this.forceRefresh();
             ctxt.unlock(calIErrors.MODIFICATION_FAILED);
             Services.startup.exitLastWindowClosingSurvivalArea();
             return;
         }
@@ -637,17 +637,17 @@ calICSCalendar.prototype = {
      * @param aCallback
      *           Function that will be calles after the backup is finished.
      *           will be called in the original context in which makeBackup
      *           was called
      */
     makeBackup: function(aCallback) {
         // Uses |pseudoID|, an id of the calendar, defined below
         function makeName(type) {
-            return 'calBackupData_'+pseudoID+'_'+type+'.ics';
+            return "calBackupData_" + pseudoID + "_" + type + ".ics";
         }
 
         // This is a bit messy. createUnique creates an empty file,
         // but we don't use that file. All we want is a filename, to be used
         // in the call to copyTo later. So we create a file, get the filename,
         // and never use the file again, but write over it.
         // Using createUnique anyway, because I don't feel like
         // re-implementing it
@@ -666,17 +666,18 @@ calICSCalendar.prototype = {
             dailyBackupFile = null;
 
             return dailyBackupFileName;
         }
 
         function purgeBackupsByType(files, type) {
             // filter out backups of the type we care about.
             var filteredFiles = files.filter(
-                v => v.name.includes("calBackupData_"+pseudoID+"_"+type));
+                v => v.name.includes("calBackupData_" + pseudoID + "_" + type)
+            );
             // Sort by lastmodifed
             filteredFiles.sort(
                 function s(a, b) {
                     return (a.lastmodified - b.lastmodified);
                 });
             // And delete the oldest files, and keep the desired number of
             // old backups
             var i;
@@ -768,17 +769,17 @@ calICSCalendar.prototype = {
         initialBackupFile.append(makeName('initial'));
         if (!initialBackupFile.exists()) {
             doInitialBackup = true;
         }
 
         var doDailyBackup = false;
         var backupTime = this.getProperty('backup-time2');
         if (!backupTime ||
-            (new Date().getTime() > backupTime + backupDays*24*60*60*1000)) {
+            (new Date().getTime() > backupTime + backupDays * 24 * 60 * 60 * 1000)) {
             // It's time do to a daily backup
             doDailyBackup = true;
             this.setProperty('backup-time2', new Date().getTime());
         }
 
         var dailyBackupFileName;
         if (doDailyBackup) {
             dailyBackupFileName = makeDailyFileName(backupDir);
@@ -992,17 +993,17 @@ httpHooks.prototype = {
     },
 
     onBeforePut: function(aChannel) {
         if (this.mEtag) {
             var httpchannel = aChannel.QueryInterface(Components.interfaces.nsIHttpChannel);
 
             // Apache doesn't work correctly with if-match on a PUT method,
             // so use the webdav header
-            httpchannel.setRequestHeader("If", '(['+this.mEtag+'])', false);
+            httpchannel.setRequestHeader("If", '([' + this.mEtag + '])', false);
         }
         return true;
     },
 
     onAfterPut: function(aChannel, aRespFunc) {
         var httpchannel = aChannel.QueryInterface(Components.interfaces.nsIHttpChannel);
         try {
             this.mEtag = httpchannel.getResponseHeader("ETag");
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -1126,25 +1126,25 @@ calStorageCalendar.prototype = {
             var floatingEventStart = "event_start_tz = 'floating' AND event_start"
             var nonFloatingEventStart = "event_start_tz != 'floating' AND event_start"
             var floatingEventEnd = "event_end_tz = 'floating' AND event_end"
             var nonFloatingEventEnd = "event_end_tz != 'floating' AND event_end"
             // The query needs to take both floating and non floating into account
             this.mSelectNonRecurringEventsByRange = this.mDB.createStatement(
                 "SELECT * FROM cal_events " +
                 "WHERE " +
-                " (("+floatingEventEnd+" > :range_start + :start_offset) OR " +
-                "  ("+nonFloatingEventEnd+" > :range_start) OR " +
-                "  ((("+floatingEventEnd+" = :range_start + :start_offset) OR " +
-                "    ("+nonFloatingEventEnd+" = :range_start)) AND " +
-                "   (("+floatingEventStart+" = :range_start + :start_offset) OR " +
-                "    ("+nonFloatingEventStart+" = :range_start)))) " +
+                " ((" + floatingEventEnd + " > :range_start + :start_offset) OR " +
+                "  (" + nonFloatingEventEnd + " > :range_start) OR " +
+                "  (((" + floatingEventEnd + " = :range_start + :start_offset) OR " +
+                "    (" + nonFloatingEventEnd + " = :range_start)) AND " +
+                "   ((" + floatingEventStart + " = :range_start + :start_offset) OR " +
+                "    (" + nonFloatingEventStart + " = :range_start)))) " +
                 " AND " +
-                "  (("+floatingEventStart+" < :range_end + :end_offset) OR " +
-                "   ("+nonFloatingEventStart+" < :range_end)) " +
+                "  (("+ floatingEventStart + " < :range_end + :end_offset) OR " +
+                "   ("+ nonFloatingEventStart + " < :range_end)) " +
                 " AND cal_id = :cal_id AND flags & 16 == 0 AND recurrence_id IS NULL" +
                 " AND ((:offline_journal IS NULL " +
                 " AND  (offline_journal IS NULL " +
                 "  OR   offline_journal != " + cICL.OFFLINE_FLAG_DELETED_RECORD + ")) " +
                 "  OR (offline_journal == :offline_journal))"
                 );
 
             //
@@ -1158,34 +1158,34 @@ calStorageCalendar.prototype = {
             var floatingTodoDue = "todo_due_tz = 'floating' AND todo_due";
             var nonFloatingTodoDue = "todo_due_tz != 'floating' AND todo_due";
             var floatingCompleted = "todo_completed_tz = 'floating' AND todo_completed";
             var nonFloatingCompleted = "todo_completed_tz != 'floating' AND todo_completed";
 
             this.mSelectNonRecurringTodosByRange = this.mDB.createStatement(
                 "SELECT * FROM cal_todos " +
                 "WHERE " +
-                "(((("+floatingTodoDue+" > :range_start + :start_offset) OR " +
-                "   ("+nonFloatingTodoDue+" > :range_start)) AND " +
+                "(((("+ floatingTodoDue + " > :range_start + :start_offset) OR " +
+                "   ("+ nonFloatingTodoDue + " > :range_start)) AND " +
                 "  ((todo_entry IS NULL) OR " +
-                "   (("+floatingTodoEntry+" < :range_end + :end_offset) OR " +
-                "    ("+nonFloatingTodoEntry+" < :range_end)))) OR " +
-                " ((("+floatingTodoDue+" = :range_start + :start_offset) OR " +
-                "   ("+nonFloatingTodoDue+" = :range_start)) AND " +
+                "   (("+ floatingTodoEntry + " < :range_end + :end_offset) OR " +
+                "    ("+ nonFloatingTodoEntry + " < :range_end)))) OR " +
+                " ((("+ floatingTodoDue + " = :range_start + :start_offset) OR " +
+                "   ("+ nonFloatingTodoDue + " = :range_start)) AND " +
                 "  ((todo_entry IS NULL) OR " +
-                "   (("+floatingTodoEntry+" = :range_start + :start_offset) OR " +
-                "    ("+nonFloatingTodoEntry+" = :range_start)))) OR " +
+                "   (("+ floatingTodoEntry + " = :range_start + :start_offset) OR " +
+                "    ("+ nonFloatingTodoEntry + " = :range_start)))) OR " +
                 " ((todo_due IS NULL) AND " +
-                "  ((("+floatingTodoEntry+" >= :range_start + :start_offset) OR " +
-                "    ("+nonFloatingTodoEntry+" >= :range_start)) AND " +
-                "   (("+floatingTodoEntry+" < :range_end + :end_offset) OR " +
-                "    ("+nonFloatingTodoEntry+" < :range_end)))) OR " +
+                "  ((("+ floatingTodoEntry +" >= :range_start + :start_offset) OR " +
+                "    ("+ nonFloatingTodoEntry +" >= :range_start)) AND " +
+                "   (("+ floatingTodoEntry +" < :range_end + :end_offset) OR " +
+                "    ("+ nonFloatingTodoEntry +" < :range_end)))) OR " +
                 " ((todo_entry IS NULL) AND " +
-                "  ((("+floatingCompleted+" > :range_start + :start_offset) OR " +
-                "    ("+nonFloatingCompleted+" > :range_start)) OR " +
+                "  ((("+ floatingCompleted +" > :range_start + :start_offset) OR " +
+                "    ("+ nonFloatingCompleted +" > :range_start)) OR " +
                 "   (todo_completed IS NULL)))) " +
                 " AND cal_id = :cal_id AND flags & 16 == 0 AND recurrence_id IS NULL " +
                 " AND ((:offline_journal IS NULL" +
                 " AND  (offline_journal IS NULL" +
                 "  OR   offline_journal != " + cICL.OFFLINE_FLAG_DELETED_RECORD + ")) " +
                 "  OR (offline_journal == :offline_journal))"
                 );
 
--- a/calendar/providers/storage/calStorageUpgrade.jsm
+++ b/calendar/providers/storage/calStorageUpgrade.jsm
@@ -367,17 +367,17 @@ function ensureUpdatedTimezones(db) {
         versionComp = Services.vc.compare(tzServiceVersion, version);
     }
 
     if (versionComp != 0) {
         cal.LOG("[calStorageCalendar] Timezones have been changed from " + version + " to " + tzServiceVersion + ", updating calendar data.");
 
         let zonesToUpdate = [];
         let getZones = createStatement(db,
-            "SELECT DISTINCT(zone) FROM ("+
+            "SELECT DISTINCT(zone) FROM (" +
             "SELECT recurrence_id_tz AS zone FROM cal_attendees    WHERE recurrence_id_tz IS NOT NULL UNION " +
             "SELECT recurrence_id_tz AS zone FROM cal_events       WHERE recurrence_id_tz IS NOT NULL UNION " +
             "SELECT event_start_tz   AS zone FROM cal_events       WHERE event_start_tz   IS NOT NULL UNION " +
             "SELECT event_end_tz     AS zone FROM cal_events       WHERE event_end_tz     IS NOT NULL UNION " +
             "SELECT recurrence_id_tz AS zone FROM cal_properties   WHERE recurrence_id_tz IS NOT NULL UNION " +
             "SELECT recurrence_id_tz AS zone FROM cal_todos        WHERE recurrence_id_tz IS NOT NULL UNION " +
             "SELECT todo_entry_tz    AS zone FROM cal_todos        WHERE todo_entry_tz    IS NOT NULL UNION " +
             "SELECT todo_due_tz      AS zone FROM cal_todos        WHERE todo_due_tz      IS NOT NULL UNION " +
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -1381,17 +1381,17 @@ function calWcapCalendar_replayChangesOn
                         log("replayChangesOn(): deleted item " + item.id, this_);
                         if (this_.offlineStorage) {
                             this_.offlineStorage.deleteItem(item, writeListener);
                         }
                     } else { // modify parent instead of
                              // straight-forward deleteItem(). WTF.
                         var parent = item.parentItem.clone();
                         parent.recurrenceInfo.removeOccurrenceAt(item.recurrenceId);
-                        log("replayChangesOn(): modified parent "+ parent.id, this_);
+                        log("replayChangesOn(): modified parent " + parent.id, this_);
                         if (this_.offlineStorage) {
                             this_.offlineStorage.modifyItem(parent, item, writeListener);
                         }
                     }
                 }
             }, "replayChangesOn() netFinishedRespFunc");
         request_.attachSubRequest(request);
 
--- a/calendar/resources/content/datetimepickers/datetimepickers.xml
+++ b/calendar/resources/content/datetimepickers/datetimepickers.xml
@@ -50,22 +50,22 @@
         goButton.setAttribute("label", calGetString("calendar", "go"));
         // Load the stuff we're going to use to parse written dates
         this.mRelativeDates = [
             {word: cal.calGetString("calendar", "today").toLowerCase(), offset: 0},
             {word: cal.calGetString("calendar", "yesterday").toLowerCase(), offset: -1},
             {word: cal.calGetString("calendar", "tomorrow").toLowerCase(), offset: 1}];
         var i;
         for (i = 1; i <= 7; i++) {
-          this.mDayNames.push(calGetString("dateFormat", "day."+i+".name").toLowerCase());
+          this.mDayNames.push(calGetString("dateFormat", "day." + i + ".name").toLowerCase());
         }
 
         for (i = 1; i <= 12; i++) {
-          this.mMonthLongNames.push(calGetString("dateFormat", "month."+i+".name").toLowerCase());
-          this.mMonthShortNames.push(calGetString("dateFormat", "month."+i+".Mmm").toLowerCase());
+          this.mMonthLongNames.push(calGetString("dateFormat", "month." + i + ".name").toLowerCase());
+          this.mMonthShortNames.push(calGetString("dateFormat", "month." + i + ".Mmm").toLowerCase());
         }
 
         // note that some languages have different conjugations of
         // next/last depending on the day
         this.mRelationWords = [
             {word: cal.calGetString("calendar", "last1"), offset: -1},
             {word: cal.calGetString("calendar", "last2"), offset: -1},
             {word: cal.calGetString("calendar", "next1"), offset: 0},
@@ -123,17 +123,17 @@
            if (!aValue) {
              return null;
            }
            var val = aValue.toLowerCase();
            // Look for the easy ones like today, tomorrow, etc
            for (var rel of this.mRelativeDates) {
              if (val == rel.word) {
                var now = new Date();
-               now.setDate(now.getDate()+rel.offset);
+               now.setDate(now.getDate() + rel.offset);
                return now;
              }
            }
 
            var parser = this;
 
            // Takes a written day of the week and returns a js-date
            // corresponding to the nearest day in the future that is
@@ -161,26 +161,26 @@
            if (!val.includes(' ')) {
              // Just a single word, or a single date.
              return getDateForDay(val);
            }
 
            // Replace month names with numbers
            for (let i in this.mMonthLongNames) {
              if (val.includes(this.mMonthLongNames[i])) {
-               let newVal = val.replace(this.mMonthLongNames[i], Number(i)+1);
+               let newVal = val.replace(this.mMonthLongNames[i], Number(i) + 1);
                newVal = newVal.replace(' ', '/');
                return this.parseDateTime(newVal);
              }
           }
 
           // Same for short month names
            for (let i in this.mMonthShortNames) {
              if (val.includes(this.mMonthShortNames[i])) {
-               let newVal = val.replace(this.mMonthShortNames[i], Number(i)+1);
+               let newVal = val.replace(this.mMonthShortNames[i], Number(i) + 1);
                newVal = newVal.replace(' ', '/');
                return this.parseDateTime(newVal);
              }
           }
 
           // Now for the cool 'next' and 'last'
           var words = val.split(' ');
           var offset, day;
@@ -195,17 +195,17 @@
               if (word == this.mDayNames[i]) {
                 day = getDateForDay(word);
                 break;
               }
             }
           }
 
           if (day && offset != undefined) {
-            day.setDate(day.getDate()+(7*offset));
+            day.setDate(day.getDate() + (7 * offset));
             return day;
           }
           return null;
         ]]></body>
       </method>
     </implementation>
   </binding>
 
@@ -1176,17 +1176,17 @@
             // switch to five minute view
             this.switchMinuteView( this.kMINUTE_VIEW_FIVE );
 
             // select closest five minute box,
             // BUT leave the selected time at what may NOT be an even five minutes
             // So that If they click more again the proper non-even-five minute
             // box will be selected
             var minutesByFive = this.calcNearestFiveMinutes(this.mSelectedTime);
-            var fiveMinuteItemId = "time-picker-five-minute-box-"+minutesByFive;
+            var fiveMinuteItemId = "time-picker-five-minute-box-" + minutesByFive;
             var fiveMinuteItem = document.getAnonymousElementByAttribute(this, "anonid", fiveMinuteItemId);
             this.selectMinuteItem(fiveMinuteItem);
           ]]>
         </body>
       </method>
 
       <!-- Called when one of the hour boxes is clicked -->
       <method name="clickHour">
@@ -1407,17 +1407,17 @@
             amLabelBox.firstChild.setAttribute("value", aAmLabel);
             let pmLabelBox = document.getAnonymousElementByAttribute(this, "anonid", "pmLabelBox");
             pmLabelBox.removeAttribute("hidden");
             pmLabelBox.firstChild.setAttribute("value", aPmLabel);
             document.getAnonymousElementByAttribute(this, "anonid", "time-picker-hour-box-0")
                     .setAttribute("label", "12");
             for (let i = 13; i < 24; i++) {
               document.getAnonymousElementByAttribute(this, "anonid", "time-picker-hour-box-" + i)
-                      .setAttribute("label", i-12);
+                      .setAttribute("label", i - 12);
             }
             document.getAnonymousElementByAttribute(this, "anonid", "time-picker-hour-grid")
                     .setAttribute("format12hours", "true");
           ]]>
         </body>
       </method>
     </implementation>
 
@@ -1705,35 +1705,35 @@
               if (aValue.toLowerCase() == midnight.toLowerCase()) {
                 return new Date(0, 0, 0, 0, 0, 0, 0);
               }
             } catch(ex) {
             }
 
             var time = null;
             var timePartsArray = this.parseTimeRegExp.exec(aValue);
-            const PRE_INDEX=1, HR_INDEX=2, MIN_INDEX=4, SEC_INDEX=6, POST_INDEX=8;
+            const PRE_INDEX = 1, HR_INDEX = 2, MIN_INDEX = 4, SEC_INDEX = 6, POST_INDEX = 8;
 
             if (timePartsArray != null) {
               var hoursString = timePartsArray[HR_INDEX]
               var hours = Number(hoursString);
               var hoursSuffix = timePartsArray[HR_INDEX + 1];
               if (!(hours >= 0 && hours < 24)) {
                 return null;
               }
 
               var minutesString = timePartsArray[MIN_INDEX];
-              var minutes = (minutesString == null? 0 : Number(minutesString));
+              var minutes = (minutesString == null ? 0 : Number(minutesString));
               var minutesSuffix = timePartsArray[MIN_INDEX + 1];
               if (!(minutes >= 0 && minutes < 60)) {
                 return null;
               }
 
               var secondsString = timePartsArray[SEC_INDEX];
-              var seconds = (secondsString == null? 0 : Number(secondsString));
+              var seconds = (secondsString == null ? 0 : Number(secondsString));
               var secondsSuffix = timePartsArray[SEC_INDEX + 1];
               if (!(seconds >= 0 && seconds < 60)) {
                 return null;
               }
 
               var ampmCode = null;
               if (timePartsArray[PRE_INDEX] || timePartsArray[POST_INDEX]) {
                 if (this.ampmIndex && timePartsArray[this.ampmIndex]) {
@@ -1785,17 +1785,17 @@
             this.alphaMonths = null;
             this.probeSucceeded = false;
             this.mLastDateParseIncludedTime = false;
 
             // SHORT NUMERIC DATE, such as 2002-03-04, 4/3/2002, or CE2002Y03M04D.
             // Made of digits & nonDigits.  (Nondigits may be unicode letters
             // which do not match \w, esp. in CJK locales.)
             this.parseShortDateRegex = /^\D*(\d+)\D+(\d+)\D+(\d+)\D?$/;
-            var probeDate = new Date(2002, 3-1, 4); // month is 0-based
+            var probeDate = new Date(2002, 2, 4); // month is 0-based
             var probeString = this.formatDate(probeDate);
             var probeArray = this.parseShortDateRegex.exec(probeString);
             if (probeArray != null) {
               // Numeric month format
               for (var i = 1; i <= 3; i++) {
                 switch (Number(probeArray[i])) {
                   case 2: this.twoDigitYear = true; // fall thru
                   case 2002: this.yearIndex = i; break;
@@ -1838,17 +1838,17 @@
                     } else {
                       this.probeSucceeded = false;
                     }
                   }
                 }
               }
             }
             if (!this.probeSucceeded) {
-              dump("\nOperating system short date format is not recognized: "+probeString+"\n");
+              dump("\nOperating system short date format is not recognized: " + probeString + "\n");
             }
           ]]>
         </body>
       </method>
 
       <!-- Time format in 24-hour format or 12-hour format with am/pm string.
            Should match formats
                 HH:mm,       H:mm,       HH:mm:ss,       H:mm:ss
@@ -1869,18 +1869,18 @@
             this.ampmIndex = null;
             // Digits         HR       sep      MIN     sep      SEC     sep
             //   Index:       2        3        4       5        6       7
             var digitsExpr = "(\\d?\\d)(\\D)?(?:(\\d\\d)(\\D)?(?:(\\d\\d)(\\D)?)?)?";
             // any letters or '.': non-digit alphanumeric, period (a.m.), or space (P M)
             var anyAmPmExpr = "(?:[^\\d\\W]|[. ])+";
             // digitsExpr has 6 captures, so index of first ampmExpr is 1, of last is 8.
             var probeTimeRegExp =
-              new RegExp("^("+anyAmPmExpr+")?\\s?"+digitsExpr+"("+anyAmPmExpr+")?\\s*$");
-            const PRE_INDEX=1, HR_INDEX=2, MIN_INDEX=4, SEC_INDEX=6, POST_INDEX=8;
+              new RegExp("^(" + anyAmPmExpr + ")?\\s?" + digitsExpr + "(" + anyAmPmExpr + ")?\\s*$");
+            const PRE_INDEX = 1, HR_INDEX = 2, MIN_INDEX = 4, SEC_INDEX = 6, POST_INDEX = 8;
             var amProbeTime = new Date(2000, 0, 1, 6, 12, 34);
             var amProbeString = amProbeTime.toLocaleFormat("%X");
             var pmProbeTime = new Date(2000, 0, 1, 18, 12, 34);
             var pmProbeString = pmProbeTime.toLocaleFormat("%X");
             var amFormatExpr = null, pmFormatExpr = null;
             if (amProbeString != pmProbeString) {
               var amProbeArray = probeTimeRegExp.exec(amProbeString);
               var pmProbeArray = probeTimeRegExp.exec(pmProbeString);
@@ -1914,54 +1914,54 @@
                   }
                 }
                 if (this.ampmIndex) {
                   var makeFormatRegExp = function(string) {
                     // make expr to accept either as provided, lowercased, or uppercased
                     var regExp = string.replace(/(\W)/g, "[$1]"); // escape punctuation
                     var lowercased = string.toLowerCase();
                     if (string != lowercased) {
-                      regExp += "|"+lowercased;
+                      regExp += "|" + lowercased;
                     }
                     var uppercased = string.toUpperCase();
                     if (string != uppercased) {
-                      regExp += "|"+uppercased;
+                      regExp += "|" + uppercased;
                     }
                     return regExp;
                   };
                   amFormatExpr = makeFormatRegExp(amProbeArray[this.ampmIndex]);
                   pmFormatExpr = makeFormatRegExp(pmProbeArray[this.ampmIndex]);
                 }
               }
             }
             // International formats ([roman, cyrillic]|arabic|chinese/kanji characters)
             // covering languages of U.N. (en,fr,sp,ru,ar,zh) and G8 (en,fr,de,it,ru,ja).
             // See examples at parseTimeOfDay.
             var amExpr =
               "[Aa\u0410\u0430][. ]?[Mm\u041c\u043c][. ]?|\u0635|\u4e0a\u5348|\u5348\u524d";
             var pmExpr =
               "[Pp\u0420\u0440][. ]?[Mm\u041c\u043c][. ]?|\u0645|\u4e0b\u5348|\u5348\u5f8c";
             if (this.ampmIndex){
-              amExpr = amFormatExpr+"|"+amExpr;
-              pmExpr = pmFormatExpr+"|"+pmExpr;
+              amExpr = amFormatExpr + "|" + amExpr;
+              pmExpr = pmFormatExpr + "|" + pmExpr;
             }
-            var ampmExpr = amExpr+"|"+pmExpr;
+            var ampmExpr = amExpr + "|" + pmExpr;
             // Must build am/pm formats into parse time regexp so that it can
             // match them without mistaking the initial char for an optional divider.
             // (For example, want to be able to parse both "12:34pm" and
             // "12H34M56Spm" for any characters H,M,S and any language's "pm".
             // The character between the last digit and the "pm" is optional.
             // Must recogize "pm" directly, otherwise in "12:34pm" the "S" pattern
             // matches the "p" character so only "m" is matched as ampm suffix.)
             //
             // digitsExpr has 6 captures, so index of first ampmExpr is 1, of last is 8.
             this.parseTimeRegExp =
-              new RegExp("("+ampmExpr+")?\\s?"+digitsExpr+"("+ampmExpr+")?\\s*$");
-            this.amRegExp = new RegExp("^(?:"+amExpr+")$");
-            this.pmRegExp = new RegExp("^(?:"+pmExpr+")$");
+              new RegExp("(" + ampmExpr + ")?\\s?" + digitsExpr + "(" + ampmExpr + ")?\\s*$");
+            this.amRegExp = new RegExp("^(?:" + amExpr + ")$");
+            this.pmRegExp = new RegExp("^(?:" + pmExpr + ")$");
             // build time display format that mimics "%x" format without seconds
             var ampmSep = (pmProbeString.includes(' ') ? " " : "");
             if (this.ampmIndex == PRE_INDEX) {
               this.kTimeFormatString = "%p" + ampmSep + "%I:%M";
             } else if (this.ampmIndex == POST_INDEX) {
               this.kTimeFormatString = "%I:%M" + ampmSep + "%p";
             } else {
               this.kTimeFormatString = "%H:%M";
@@ -1979,17 +1979,17 @@
             // if year before 1900 (e.g., typo) on MSWindows (due to MS bug).
             var nsIScriptableDateFormat =
               Components.interfaces.nsIScriptableDateFormat;
             var dateService =
               Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                         .getService(nsIScriptableDateFormat);
             return dateService.FormatDate("", dateService.dateFormatShort,
                                           aDate.getFullYear(),
-                                          aDate.getMonth()+1,
+                                          aDate.getMonth() + 1,
                                           aDate.getDate());
           ]]>
         </body>
       </method>
 
       <method name="formatTime">
         <parameter name="aValue"/>
         <body>
--- a/calendar/resources/content/mouseoverPreviews.js
+++ b/calendar/resources/content/mouseoverPreviews.js
@@ -115,17 +115,17 @@ function getPreviewForTask( toDoItem )
     {
       var status = getToDoStatusString(toDoItem);
       boxAppendLabeledText(vbox, "tooltipStatus", status);
       hasHeader = true;
     }
 
     if (toDoItem.status != null && toDoItem.percentComplete != 0 && toDoItem.percentComplete != 100)
     {
-      boxAppendLabeledText(vbox, "tooltipPercent", String(toDoItem.percentComplete)+"%");
+      boxAppendLabeledText(vbox, "tooltipPercent", String(toDoItem.percentComplete) + "%");
       hasHeader = true;
     } else if (toDoItem.percentComplete == 100)
     {
       if (toDoItem.completedDate == null) {
         boxAppendLabeledText(vbox, "tooltipPercent", "100%");
       } else {
         boxAppendLabeledDateTime(vbox, "tooltipCompleted", toDoItem.completedDate);
       }
@@ -380,12 +380,12 @@ function getCurrentNextOrPreviousRecurre
     // starting duration ago.
     var probeTime = now();
     probeTime.addDuration(dur);
 
     var occ = calendarEvent.recurrenceInfo.getNextOccurrence(probeTime);
 
     if (!occ) {
         var occs = calendarEvent.recurrenceInfo.getOccurrences(calendarEvent.startDate, probeTime, 0, {});
-        occ = occs[occs.length -1];
+        occ = occs[occs.length - 1];
     }
     return occ;
 }
--- a/calendar/resources/content/publish.js
+++ b/calendar/resources/content/publish.js
@@ -102,17 +102,17 @@ function publishEntireCalendarDialogResp
         },
         onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems)
         {
             if (!Components.isSuccessCode(aStatus)) {
                 aborted = true;
                 return;
             }
             if (aCount) {
-                for (var i=0; i<aCount; ++i) {
+                for (var i = 0; i < aCount; ++i) {
                     // Store a (short living) reference to the item.
                     var itemCopy = aItems[i].clone();
                     itemArray.push(itemCopy);
                 }
             }
         }
     };
     aProgressDialog.onStartUpload();
--- a/calendar/test/mozmill/eventDialog/testEventDialog.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialog.js
@@ -63,17 +63,17 @@ var testEventDialog = function () {
   controller.mainMenu.click("#ltnNewEvent");
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   // next full hour except last hour hour of the day
   let now = new Date();
   let hour = now.getHours();
-  let startHour = (hour == 23)? hour : (hour + 1) % 24;
+  let startHour = (hour == 23) ? hour : (hour + 1) % 24;
   let ampm = "";
   if (now.toLocaleTimeString().match(/AM|PM/)) {
     ampm = (hour >= 12 ? " PM" : " AM")
     startHour = startHour % 12;
     if (startHour == 0) {
       startHour = 12;
     }
   }
--- a/calendar/test/mozmill/testTodayPane.js
+++ b/calendar/test/mozmill/testTodayPane.js
@@ -43,17 +43,17 @@ var testTodayPane = function () {
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"today-button"})'));
   let dayNode = (new elementslib.Lookup(controller.window.document, dayPath)).getNode();
   controller.assertJS(dayNode.mDate.icalString == getIsoDate());
 
   // create event 6 hours from now, if this is tomorrow then at 23 today
   // doubleclick only triggers new event dialog on visible boxes, so scrolling may be needed
   // by default visible time is 08:00 - 17:00, box of 17th hour is out of view
   let hour = (new Date()).getHours();
-  let startHour = (hour < 18)? hour + 6 : 23;
+  let startHour = (hour < 18) ? hour + 6 : 23;
   let view = (new elementslib.Lookup(controller.window.document, dayView)).getNode();
 
   if (startHour < 8 || startHour > 16) {
     view.scrollToMinute(60 * startHour);
   }
 
   controller.doubleClick(new elementslib.Lookup(controller.window.document, dayView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/'
@@ -237,17 +237,17 @@ var testTodayPane = function () {
 //    || tomorrow.getAttribute("checked") != "true");
   controller.assertJS(!soon.hasAttribute("checked")
     || soon.getAttribute("checked") != "true");
 }
 
 var getIsoDate = function() {
   let date = new Date();
   let year = date.getFullYear();
-  let month = (date.getMonth() < 9)? '0' + (date.getMonth() + 1) : (date.getMonth() + 1);
-  let day = (date.getDate() < 10)? '0' + date.getDate() : date.getDate();
+  let month = (date.getMonth() < 9) ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1);
+  let day = (date.getDate() < 10) ? '0' + date.getDate() : date.getDate();
   let isoDate = year + '' + month + '' + day;
   return isoDate;
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, MOZMILL_CALENDAR);
 }
--- a/calendar/test/mozmill/views/testMonthView.js
+++ b/calendar/test/mozmill/views/testMonthView.js
@@ -65,17 +65,17 @@ var testMonthView = function () {
   controller.doubleClick(new elementslib.Lookup(controller.window.document, monthView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/'
     + '[0]/{"selected":"true"}/anon({"anonid":"day-items"})'));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   // next full hour except last hour hour of the day
-  let nextHour = (hour == 23)? hour : (hour + 1) % 24;
+  let nextHour = (hour == 23) ? hour : (hour + 1) % 24;
   let startTime = nextHour + ':00'; // next full hour
   let startTimeInput = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-startdate-row")/id("event-grid-startdate-picker-box")/'
     + 'id("event-starttime")/anon({"anonid":"hbox"})/anon({"anonid":"time-picker"})/'
     + 'anon({"class":"timepicker-box-class"})/anon({"class":"timepicker-text-class"})/'
     + 'anon({"flex":"1"})/anon({"anonid":"input"})');
   event.waitForElement(startTimeInput);
   event.assertValue(startTimeInput, startTime);
--- a/calendar/test/mozmill/views/testMultiweekView.js
+++ b/calendar/test/mozmill/views/testMultiweekView.js
@@ -65,17 +65,17 @@ var testMultiWeekView = function () {
   controller.doubleClick(new elementslib.Lookup(controller.window.document, multiWeekView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/'
     + '[0]/{"selected":"true"}/anon({"anonid":"day-items"})'));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   // next full hour except last hour hour of the day
-  let nextHour = (hour == 23)? hour : (hour + 1) % 24;
+  let nextHour = (hour == 23) ? hour : (hour + 1) % 24;
   let startTime = nextHour + ':00';
   let startTimeInput = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-startdate-row")/id("event-grid-startdate-picker-box")/'
     + 'id("event-starttime")/anon({"anonid":"hbox"})/anon({"anonid":"time-picker"})/'
     + 'anon({"class":"timepicker-box-class"})/anon({"class":"timepicker-text-class"})/'
     + 'anon({"flex":"1"})/anon({"anonid":"input"})');
   event.waitForElement(startTimeInput);
   event.assertValue(startTimeInput, startTime);
--- a/calendar/test/unit/test_attendee.js
+++ b/calendar/test/unit/test_attendee.js
@@ -206,17 +206,17 @@ function test_doubleParameters() {
                 parNames.push(paramName);
                 parValues.push(prop.getParameter(paramName));
             }
 
             // Check the results
             let att_n = attendee.id.substr(7, 9);
             for (let parIndex in parNames) {
                 ok(aExpected[att_n].param.includes(parNames[parIndex]),
-                   "Parameter " + parNames[parIndex] + " included in "+ att_n);
+                   "Parameter " + parNames[parIndex] + " included in " + att_n);
                 ok(aExpected[att_n].values.includes(parValues[parIndex]),
                    "Value " + parValues[parIndex] + " for parameter " + parNames[parIndex]);
             }
             ok(parNames.length == aExpected[att_n].param.length,
                "Each parameter has been considered for " + att_n);
         }
     }
 
--- a/calendar/test/unit/test_bug1199942.js
+++ b/calendar/test/unit/test_bug1199942.js
@@ -21,35 +21,35 @@ function createAttendee_test() {
         attendee.id = test.input;
         event.addAttendee(attendee);
         let readAttendee = event.getAttendeeById(cal.prependMailTo(test.input));
         equal(readAttendee.id, test.expected);
     }
 }
 
 function serializeEvent_test() {
-    let ics= "BEGIN:VCALENDAR\n" +
-             "PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN\n" +
-             "VERSION:2.0\n" +
-             "BEGIN:VEVENT\n" +
-             "CREATED:20150801T213509Z\n" +
-             "LAST-MODIFIED:20150830T164104Z\n" +
-             "DTSTAMP:20150830T164104Z\n" +
-             "UID:a84c74d1-cfc6-4ddf-9d60-9e4afd8238cf\n" +
-             "SUMMARY:New Event\n" +
-             "ORGANIZER;RSVP=TRUE;CN=Tester1;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:user1@example.net\n" +
-             "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:MAILTO:user2@example.net\n" +
-             "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:mailto:user3@example.net\n" +
-             "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:user4@example.net\n" +
-             "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:urn:uuid:user5\n" +
-             "DTSTART:20150729T103000Z\n" +
-             "DTEND:20150729T113000Z\n" +
-             "TRANSP:OPAQUE\n" +
-             "END:VEVENT\n" +
-             "END:VCALENDAR\n";
+    let ics = "BEGIN:VCALENDAR\n" +
+              "PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN\n" +
+              "VERSION:2.0\n" +
+              "BEGIN:VEVENT\n" +
+              "CREATED:20150801T213509Z\n" +
+              "LAST-MODIFIED:20150830T164104Z\n" +
+              "DTSTAMP:20150830T164104Z\n" +
+              "UID:a84c74d1-cfc6-4ddf-9d60-9e4afd8238cf\n" +
+              "SUMMARY:New Event\n" +
+              "ORGANIZER;RSVP=TRUE;CN=Tester1;PARTSTAT=ACCEPTED;ROLE=CHAIR:mailto:user1@example.net\n" +
+              "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:MAILTO:user2@example.net\n" +
+              "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:mailto:user3@example.net\n" +
+              "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:user4@example.net\n" +
+              "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT:urn:uuid:user5\n" +
+              "DTSTART:20150729T103000Z\n" +
+              "DTEND:20150729T113000Z\n" +
+              "TRANSP:OPAQUE\n" +
+              "END:VEVENT\n" +
+              "END:VCALENDAR\n";
 
     let expectedIds = ["mailto:user2@example.net",
                        "mailto:user3@example.net",
                        "mailto:user4@example.net",
                        "urn:uuid:user5"];
     let event = createEventFromIcalString(ics);
     let attendees = event.getAttendees({});
 
--- a/calendar/test/unit/test_datetime.js
+++ b/calendar/test/unit/test_datetime.js
@@ -41,20 +41,20 @@ function really_run_test() {
     equal(cd.nativeTime, cd_allday.nativeTime);
 
     // Daylight savings test
     cd.resetTo(2006, 2, 26,
                1, 0, 0,
                getMozTimezone("/mozilla.org/20050126_1/Europe/Amsterdam"));
 
     equal(cd.weekday, 0);
-    equal(cd.timezoneOffset, 1*3600);
+    equal(cd.timezoneOffset, 1 * 3600);
 
     cd.day += 1;
-    equal(cd.timezoneOffset, 2*3600);
+    equal(cd.timezoneOffset, 2 * 3600);
 
     // Bug 398724 - Problems with floating all-day items
     let event = cal.createEvent("BEGIN:VEVENT\nUID:45674d53-229f-48c6-9f3b-f2b601e7ae4d\nSUMMARY:New Event\nDTSTART;VALUE=DATE:20071003\nDTEND;VALUE=DATE:20071004\nEND:VEVENT");
     ok(event.startDate.timezone.isFloating);
     ok(event.endDate.timezone.isFloating);
 
     // Bug 392853 - Same times, different timezones, but subtractDate says times are PT0S apart
     const zeroLength = cal.createDuration();
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -908,17 +908,17 @@ add_task(function* test_basicItems() {
     ];
 
     let client = yield gServer.getClient();
     let pclient = cal.async.promisifyCalendar(client);
 
     let items = yield pclient.getAllItems();
     equal(items.length, 2);
 
-    let event = cal.isEvent(items[0]) ? items[0]: items[1];
+    let event = cal.isEvent(items[0]) ? items[0] : items[1];
     equal(event.id, "go6ijb0b46hlpbu4eeu92njevo@google.com");
     equal(event.getProperty("STATUS"), "CONFIRMED");
     equal(event.getProperty("URL"), gServer.baseUri + "/calendar/event?eid=eventhash");
     equal(event.getProperty("CREATED").icalString, "20060608T210452Z");
     equal(event.getProperty("LAST-MODIFIED").icalString, "20060608T210549Z");
     equal(event.title, "New Event");
     equal(event.getProperty("DESCRIPTION"), "description");
     equal(event.getProperty("LOCATION"), "Hard Drive");
--- a/calendar/test/unit/test_ics_service.js
+++ b/calendar/test/unit/test_ics_service.js
@@ -223,17 +223,17 @@ function test_param() {
 function test_iterator() {
     let svc = cal.getIcsService();
 
     // Property iterator
     let comp = svc.createIcalComponent("VEVENT");
     let propNames = ["X-ONE", "X-TWO"];
     for (let i = 0; i < propNames.length; i++) {
         let prop = svc.createIcalProperty(propNames[i]);
-        prop.value = "" + (i+1);
+        prop.value = "" + (i + 1);
         comp.addProperty(prop);
     }
 
     for (let p = comp.getFirstProperty("ANY");
          p;
          p = comp.getNextProperty("ANY")) {
         equal(p.propertyName, propNames.shift());
         equal(p.parent.toString(), comp.toString());
@@ -258,17 +258,17 @@ function test_iterator() {
         equal(p.value, propValues.shift());
         equal(p.parent.toString(), comp.toString());
     }
 
     // Param iterator
     let prop = svc.createIcalProperty("DTSTART");
     let params = ["X-ONE", "X-TWO"];
     for (let i = 0; i < params.length; i++) {
-        prop.setParameter(params[i], "" + (i+1));
+        prop.setParameter(params[i], "" + (i + 1));
     }
 
     for (let p = prop.getFirstParameterName();
          p;
          p = prop.getNextParameterName()) {
         equal(p, params.shift());
     }
 
--- a/calendar/test/unit/test_recur.js
+++ b/calendar/test/unit/test_recur.js
@@ -50,28 +50,28 @@ function test_rules() {
             if (ignoreNextOccCheck) {
                 continue;
             }
 
             // Make sure getNextOccurrence works correctly
             let nextOcc = event.recurrenceInfo.getNextOccurrence(recdates[i]);
             if (expected.length > i + 1) {
                 notEqual(nextOcc, null);
-                dump("Checking next occurrence: " + expected[i+1]+"\n");
+                dump("Checking next occurrence: " + expected[i + 1] + "\n");
                 equal(nextOcc.startDate.icalString, expected[i + 1]);
             } else {
                 dump("Expecting no more occurrences, found " +
                         (nextOcc ? nextOcc.startDate : null) + "\n");
                 equal(nextOcc, null);
             }
 
             // Make sure getPreviousOccurrence works correctly
             let prevOcc = event.recurrenceInfo.getPreviousOccurrence(recdates[i]);
             if (i > 0) {
-                dump("Checking previous occurrence: " + expected[i-1]+", found " + (prevOcc ? prevOcc.startDate : prevOcc) + "\n");
+                dump("Checking previous occurrence: " + expected[i - 1] + ", found " + (prevOcc ? prevOcc.startDate : prevOcc) + "\n");
                 notEqual(prevOcc, null);
                 equal(prevOcc.startDate.icalString, expected[i - 1]);
             } else {
                 dump("Expecting no previous occurrences, found " +
                         (prevOcc ? prevOcc.startDate : prevOcc) + "\n");
                 equal(prevOcc, null);
             }
         }
@@ -246,17 +246,17 @@ function test_rules() {
                 "20140305T150000Z", "20140307T150000Z", "20140312T150000Z", "20140314T150000Z",
                 "20140319T150000Z", "20140321T150000Z", "20140326T150000Z", "20140328T150000Z"],
                false);
 
     // Bug 958978 - Check a yearly recurrence every day of January (BYMONTH and more BYDAY).
     // Check for all the occurrences in the first year.
     let expectedDates = [];
     for (let i = 1; i < 32; i++) {
-        expectedDates.push("201401" + (i<10 ? "0"+i : i) + "T150000Z");
+        expectedDates.push("201401" + (i < 10 ? "0" + i : i) + "T150000Z");
     }
     check_recur(createEventFromIcalString("BEGIN:VCALENDAR\nBEGIN:VEVENT\n" +
                                          "DESCRIPTION:Yearly, every day of January (one BYMONTH and more BYDAY)\n" +
                                          "RRULE:FREQ=YEARLY;COUNT=31;BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA\n" +
                                          "DTSTART:20140101T150000Z\n" +
                                          "DTEND:20140101T160000Z\n" +
                                          "END:VEVENT\nEND:VCALENDAR\n"),
                 expectedDates,