Bug 1280898 - Set up eslint for calendar files - initial rules and minimal automatic fixes. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Fri, 08 Jul 2016 11:14:45 +0200
changeset 26714 b1be8f5e02be13b1fb3ea3734c095e0e4f784b3a
parent 26713 7567d39ae92880708c25b023f8428be8d5afd51d
child 26715 236b9899c452443b01830bc85071c5a14c0f0ae4
push id353
push userclokep@gmail.com
push dateMon, 23 Jan 2017 21:39:40 +0000
reviewersMakeMyDay
bugs1280898
Bug 1280898 - Set up eslint for calendar files - initial rules and minimal automatic fixes. r=MakeMyDay MozReview-Commit-ID: 5UnTP50Iqtv
.eslintignore
calendar/.eslintrc
calendar/base/backend/icaljs/calICSService.js
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-item-bindings.xml
calendar/base/content/calendar-month-view.xml
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-task-tree.js
calendar/base/content/calendar-task-tree.xml
calendar/base/content/calendar-task-view.js
calendar/base/content/calendar-unifinder-todo.js
calendar/base/content/calendar-view-core.xml
calendar/base/content/calendar-views.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-freebusy.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
calendar/base/content/dialogs/calendar-event-dialog-reminder.js
calendar/base/content/dialogs/calendar-event-dialog-timezone.js
calendar/base/content/dialogs/calendar-invitations-list.xml
calendar/base/content/dialogs/calendar-summary-dialog.js
calendar/base/content/preferences/categories.js
calendar/base/content/widgets/calendar-subscriptions-list.xml
calendar/base/content/widgets/calendar-widgets.xml
calendar/base/content/widgets/minimonth.xml
calendar/base/modules/calIteratorUtils.jsm
calendar/base/modules/calItipUtils.jsm
calendar/base/modules/calUtils.jsm
calendar/base/src/calDefaultACLManager.js
calendar/base/src/calItemBase.js
calendar/base/src/calRecurrenceInfo.js
calendar/base/src/calTimezoneService.js
calendar/base/src/calUtils.js
calendar/base/src/calWeekInfoService.js
calendar/import-export/calOutlookCSVImportExport.js
calendar/lightning/components/calItipProtocolHandler.js
calendar/providers/caldav/calDavCalendar.js
calendar/providers/caldav/calDavRequestHandlers.js
calendar/providers/memory/calMemoryCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/storage/calStorageHelpers.jsm
calendar/providers/storage/calStorageUpgrade.jsm
calendar/providers/wcap/calWcapCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/providers/wcap/calWcapCalendarModule.js
calendar/providers/wcap/calWcapSession.js
calendar/providers/wcap/calWcapUtils.js
calendar/resources/content/datetimepickers/datetimepickers.xml
calendar/resources/content/publish.js
calendar/resources/content/publishDialog.js
calendar/test/mozmill/eventDialog/testEventDialog.js
calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
calendar/test/mozmill/eventDialog/testUTF8.js
calendar/test/mozmill/recurrence/testAnnualRecurrence.js
calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrence/testDailyRecurrence.js
calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/shared-modules/calendar-utils.js
calendar/test/mozmill/shared-modules/timezone-utils.js
calendar/test/mozmill/testBasicFunctionality.js
calendar/test/mozmill/testLocalICS.js
calendar/test/mozmill/timezoneTests/test10.js
calendar/test/mozmill/timezoneTests/test2.js
calendar/test/mozmill/timezoneTests/test3.js
calendar/test/mozmill/timezoneTests/test4.js
calendar/test/mozmill/timezoneTests/test5.js
calendar/test/mozmill/timezoneTests/test6.js
calendar/test/mozmill/timezoneTests/test7.js
calendar/test/mozmill/timezoneTests/test8.js
calendar/test/mozmill/timezoneTests/test9.js
calendar/test/mozmill/views/testDayView.js
calendar/test/mozmill/views/testMonthView.js
calendar/test/mozmill/views/testMultiweekView.js
calendar/test/mozmill/views/testTaskView.js
calendar/test/mozmill/views/testWeekView.js
calendar/test/unit/test_calutils.js
calendar/test/unit/test_datetime_before_1970.js
calendar/test/unit/test_deleted_items.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_providers.js
calendar/test/unit/test_recur.js
calendar/test/unit/test_storage.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -12,16 +12,31 @@ config/**
 db/**
 other-licenses/**
 testing/**
 
 # We ignore all these directories by default, until we get them enabled.
 # If you are enabling a directory, please add directory specific exclusions
 # below.
 build/**
-calendar/**
 chat/**
 editor/**
 im/**
 ldap/**
 mail/**
 mailnews/**
 suite/**
+
+# calendar/ exclusions
+
+# prefs files
+calendar/lightning/content/lightning.js
+calendar/locales/en-US/lightning-l10n.js
+
+# gdata-provider uses non-standard javascript for Postbox compatibility
+calendar/providers/gdata/**
+
+# third party library
+calendar/base/modules/ical.js
+
+# preprocessed files
+calendar/base/content/dialogs/calendar-migration-dialog.js
+calendar/base/content/calendar-dnd-listener.js
new file mode 100644
--- /dev/null
+++ b/calendar/.eslintrc
@@ -0,0 +1,97 @@
+{
+  "extends": [
+    "../mozilla/toolkit/.eslintrc"
+  ],
+  "rules": {
+    // Enforce newline at the end of file, with no multiple empty lines.
+    "eol-last": 2,
+
+    // Enforce the spacing around the * in generator functions.
+    "generator-star-spacing": [2, "after"],
+
+    // Disallow deletion of variables (deleting properties is fine).
+    "no-delete-var": 2,
+
+    // Disallow duplicate arguments in functions.
+    "no-dupe-args": 2,
+
+    // Disallow duplicate keys when creating object literals.
+    "no-dupe-keys": 2,
+
+    // Disallow a duplicate case label.
+    "no-duplicate-case": 2,
+
+    // Disallow the use of empty character classes in regular expressions.
+    "no-empty-character-class": 2,
+
+    // Disallow assigning to the exception in a catch block.
+    "no-ex-assign": 2,
+
+    // Disallow adding to native types
+    "no-extend-native": 2,
+
+    // Disallow double-negation boolean casts in a boolean context.
+    "no-extra-boolean-cast": 2,
+
+    // Disallow unnecessary semicolons.
+    "no-extra-semi": 2,
+
+    // Disallow mixed spaces and tabs for indentation.
+    "no-mixed-spaces-and-tabs": 2,
+
+    // Disallow reassignments of native objects.
+    "no-native-reassign": 2,
+
+    // Disallow nested ternary expressions, they make the code hard to read.
+    "no-nested-ternary": 2,
+
+    // Disallow use of octal literals.
+    "no-octal": 2,
+
+    // Disallow comparisons where both sides are exactly the same.
+    "no-self-compare": 2,
+
+    // Disallow sparse arrays, eg. let arr = [,,2].
+    // Array destructuring is fine though:
+    // for (let [, breakpointPromise] of aPromises)
+    "no-sparse-arrays": 2,
+
+    // Disallow trailing whitespace at the end of lines.
+    "no-trailing-spaces": 2,
+
+    // Disallow use of the with statement.
+    "no-with": 2,
+
+    // Disallow comparisons with the value NaN.
+    "use-isnan": 2,
+
+    // Ensure that the results of typeof are compared against a valid string.
+    "valid-typeof": 2,
+
+    // disallow the use of object properties of the global object (Math and
+    // JSON) as functions
+    "no-obj-calls": 2,
+
+    // disallow use of octal escape sequences in string literals, such as
+    // var foo = "Copyright \251";
+    "no-octal-escape": 2,
+
+    // disallow use of void operator
+    "no-void": 2,
+
+    // Will enable these rules later
+    "comma-spacing": 0,
+    "keyword-spacing": 0,
+    "block-spacing": 0,
+    "no-lonely-if": 0,
+    "space-before-blocks": 0,
+    "computed-property-spacing": 0,
+    "consistent-return": 0,
+    "no-redeclare": 0,
+    "no-empty": 0,
+
+    // The following rules will not be enabled currently, but are kept here for
+    // easier updates in the future.
+    "no-else-return": 0,
+  }
+}
--- a/calendar/base/backend/icaljs/calICSService.js
+++ b/calendar/base/backend/icaljs/calICSService.js
@@ -172,17 +172,17 @@ calIcalProperty.prototype = {
     clearXParameters: function() {
         cal.WARN("calIICSService::clearXParameters is no longer implemented, " +
                  "please use removeParameter");
     },
 
     paramIterator: null,
     getFirstParameterName: function() {
         let innerObject = this.innerObject;
-        this.paramIterator = (function*() {
+        this.paramIterator = (function* () {
             let propname = innerObject.name.toLowerCase();
             let defaultType = innerObject.getDefaultType();
             if (defaultType != innerObject.type) {
                 yield "VALUE";
             }
 
             let paramNames = Object.keys(innerObject.jCal[1] || {});
             for (let name of paramNames) {
@@ -235,17 +235,17 @@ calIcalComponent.prototype = {
     componentIterator: null,
     getFirstSubcomponent: function(kind) {
         if (kind == "ANY") {
             kind = null;
         } else if (kind) {
             kind = kind.toLowerCase();
         }
         let innerObject = this.innerObject;
-        this.componentIterator = (function*() {
+        this.componentIterator = (function* () {
             let comps = innerObject.getAllSubcomponents(kind);
             if (comps) {
                 for (let comp of comps) {
                     yield new calIcalComponent(comp);
                 }
             }
         })();
         return this.getNextSubcomponent(kind)
@@ -355,17 +355,17 @@ calIcalComponent.prototype = {
     propertyIterator: null,
     getFirstProperty: function getFirstProperty(kind) {
         if (kind == "ANY") {
             kind = null;
         } else if (kind) {
             kind = kind.toLowerCase();
         }
         let innerObject = this.innerObject;
-        this.propertyIterator = (function*() {
+        this.propertyIterator = (function* () {
             let props = innerObject.getAllProperties(kind);
             if (!props) {
                 return;
             }
             for (var prop of props) {
                 let hell = prop.getValues();
                 if (hell.length > 1) {
                     // Uh oh, multiple property values. Our code expects each as one
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -121,17 +121,17 @@ 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;
     // 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", 
+    document.getElementById(listItem.id + "-hidden").setAttribute("checked",
                             periodCheckbox.getAttribute("checked"));
     if (lopen) {
         agendaListbox.refreshCalendarQuery(period.start, period.end);
     } else {
         listItem = listItem.nextSibling;
         do {
             var leaveloop = (listItem == null);
             if (!leaveloop) {
@@ -139,17 +139,17 @@ function onCheckboxChange(event) {
                 leaveloop = (!agendaListbox.isEventListItem(listItem));
                 if (!leaveloop) {
                     listItem.remove();
                     listItem = nextItemSibling;
                 }
             }
         } while (!leaveloop);
     }
-    calendarController.onSelectionChanged({detail: []});    
+    calendarController.onSelectionChanged({detail: []});
 };
 
 /**
  * Handler function called when an agenda listbox item is selected
  *
  * @param aListItem     The agenda-base-richlist-item that was selected.
  */
 agendaListbox.onSelect =
@@ -455,17 +455,17 @@ function comparisonDate(aItem, aPeriod) 
  * @param aPeriod       (optional) the period to search in.
  * @return              An array of list items for the given item.
  */
 agendaListbox.getListItems =
 function getListItems(aItem, aPeriod) {
     var retlistItems = new Array();
     var periods = [aPeriod];
     if (!aPeriod) {
-        var periods = this.findPeriodsForItem(aItem);
+        periods = this.findPeriodsForItem(aItem);
     }
     if (periods.length > 0) {
         for (var i = 0; i < periods.length; i++) {
             let period = periods[i];
             let complistItem = period.listItem;
             do {
                 complistItem = complistItem.nextSibling;
                 var leaveloop = (!this.isEventListItem(complistItem));
@@ -1067,22 +1067,22 @@ function setCurrentEvent() {
         var removelist = [];
         var anow = now();
         var msuntillend = 0;
         var msuntillstart = 0;
         do {
             var leaveloop = (!agendaListbox.isEventListItem(complistItem));
             if (!leaveloop) {
                 msuntillstart =  complistItem.occurrence.startDate
-                                .getInTimezone(agendaListbox.kDefaultTimezone)
-                                .subtractDate(anow).inSeconds;
+                                             .getInTimezone(agendaListbox.kDefaultTimezone)
+                                             .subtractDate(anow).inSeconds;
                 if (msuntillstart <= 0) {
-                    var msuntillend = complistItem.occurrence.endDate
-                                        .getInTimezone(agendaListbox.kDefaultTimezone)
-                                        .subtractDate(anow).inSeconds;
+                    msuntillend = complistItem.occurrence.endDate
+                                              .getInTimezone(agendaListbox.kDefaultTimezone)
+                                              .subtractDate(anow).inSeconds;
                     if (msuntillend > 0) {
                         complistItem.setAttribute("current", "true");
                         if ((msuntillend < msScheduleTime)  || (msScheduleTime == -1)){
                             msScheduleTime = msuntillend;
                         }
                     } else {
                          removelist.push(complistItem);
                     }
--- a/calendar/base/content/calendar-item-bindings.xml
+++ b/calendar/base/content/calendar-item-bindings.xml
@@ -41,43 +41,44 @@
         ]]></getter>
       </property>
       <property name="Item">
         <getter><![CDATA[
             return mItem;
         ]]></getter>
         <setter><![CDATA[
           this.mItem = val;
-          var headerLabel = document.getAnonymousElementByAttribute(this, "anonid", "item-datetime-label");
-          var itemDateTimeLabel = document.getAnonymousElementByAttribute(this, "anonid", "item-datetime-value");
+          let headerLabel = document.getAnonymousElementByAttribute(this, "anonid", "item-datetime-label");
+          let itemDateTimeLabel = document.getAnonymousElementByAttribute(this, "anonid", "item-datetime-value");
+          let date;
           if (this.mode == "start") {
-              var date = this.mItem[calGetStartDateProp(this.mItem)];
+              date = this.mItem[calGetStartDateProp(this.mItem)];
               //this.mItem.startDate || this.mItem.entryDate;
               if (date) {
                   let label;
                   if (isToDo(this.mItem)) {
                       label = this.getAttribute("taskStartLabel");
                   } else {
                       label = this.getAttribute("eventStartLabel");
                   }
                   headerLabel.value = label;
               }
           } else {
-              var date = this.mItem[calGetEndDateProp(this.mItem)];
+              date = this.mItem[calGetEndDateProp(this.mItem)];
               if (date) {
                   let label;
                   if (isToDo(this.mItem)) {
                           label = this.getAttribute("taskDueLabel");
                   } else {
                       label = this.getAttribute("eventEndLabel");
                   }
                   headerLabel.value = label;
               }
           }
-          var hideLabels = (date == null);
+          let hideLabels = (date == null);
           if (hideLabels) {
               this.setAttribute("hidden", "true");
           } else {
               const kDefaultTimezone = cal.calendarDefaultTimezone();
               let localTime = date.getInTimezone(kDefaultTimezone);
               let formatter = getDateFormatter();
               itemDateTimeLabel.value = formatter.formatDateTime(localTime);
               if (date.timezone.tzid != kDefaultTimezone.tzid) {
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -513,20 +513,16 @@
                    // Refresh the view so the settings take effect
                    this.refreshView();
                    break;
 
                case "calendar.weeks.inview":
                    this.weeksInView = aSubject.getIntPref(aPreference);
                    break;
 
-               case "calendar.previousweeks.inview":
-                   this.refreshView();
-                   break;
-
                case "calendar.view-minimonth.showWeekNumber":
                    this.mShowWeekNumber = aSubject.getBoolPref(aPreference);
                    if (this.mShowWeekNumber) {
                        this.refreshView();
                    } else {
                        this.hideWeekNumbers();
                    }
                    break;
@@ -548,28 +544,28 @@
       </method>
 
       <method name="setSelectedItems">
         <parameter name="aCount"/>
         <parameter name="aItems"/>
         <parameter name="aSuppressEvent"/>
         <body><![CDATA[
           if (this.mSelectedItems.length) {
-              for (var item of this.mSelectedItems) {
+              for (let item of this.mSelectedItems) {
                   let oldboxes = this.findDayBoxesForItem(item);
                   for (let oldbox of oldboxes) {
                       oldbox.unselectItem(item);
                   }
               }
           }
 
           this.mSelectedItems = aItems || [];
 
           if (this.mSelectedItems.length) {
-              for (var item of this.mSelectedItems) {
+              for (let item of this.mSelectedItems) {
                   let newboxes = this.findDayBoxesForItem(item);
                   for (let newbox of newboxes) {
                       newbox.selectItem(item);
                   }
               }
           }
 
           if (!aSuppressEvent) {
@@ -772,23 +768,23 @@
           var dateList = this.getDateList({})
 
           // This allows to find the first column of dayboxes where to set the
           // week labels taking into account whether days-off are displayed or not.
           let weekLabelColumnPos = -1;
 
           var rows = this.monthgridrows.childNodes;
 
-          // Iterate through each monthgridrow and set up the day-boxes that 
+          // Iterate through each monthgridrow and set up the day-boxes that
           // are its child nodes.  Remember, childNodes is not a normal array,
-          // so don't use the in operator if you don't want extra properties 
+          // so don't use the in operator if you don't want extra properties
           // coming out.
           for (var i = 0; i < rows.length; i++) {
             var row = rows[i];
-            // If we've already assigned all of the day-boxes that we need, just 
+            // If we've already assigned all of the day-boxes that we need, just
             // collapse the rest of the rows, otherwise expand them if needed.
             if (finished) {
               row.setAttribute("collapsed", true);
               continue;
             } else {
               row.removeAttribute("collapsed");
             }
             for (var j = 0; j < row.childNodes.length; j++) {
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -2444,17 +2444,17 @@
 
                 this.parentColumn.startSweepingToModifyEvent(this, this.mOccurrence, "middle", this.mMouseX, this.mMouseY);
                 this.mInMouseDown = false;
             }
         }
       ]]></handler>
 
       <handler event="mouseout"><![CDATA[
-        if (!this.mEditing && this.mInMouseDown && this.parentColumn) { 
+        if (!this.mEditing && this.mInMouseDown && this.parentColumn) {
             if (this.editingTimer) {
                 clearTimeout(this.editingTimer);
                 this.editingTimer = null;
             }
 
             this.calendarView.setSelectedItems(1, [this.mOccurrence]);
 
             this.mEditing = false;
@@ -2886,26 +2886,27 @@
           }
 
         ]]></body>
       </method>
 
       <method name="getDateList">
         <parameter name="aCount"/>
         <body><![CDATA[
-           var dates = new Array();
+           let dates = new Array();
            if (this.mStartDate && this.mEndDate) {
-               var d = this.mStartDate.clone();
+               let d = this.mStartDate.clone();
                while (d.compare(this.mEndDate) <= 0) {
                    dates.push(d.clone());
                    d.day += 1;
                }
            } else if (this.mDateList) {
-               for (var d of this.mDateList)
+               for (let d of this.mDateList) {
                    dates.push(d.clone());
+               }
            }
 
            aCount.value = dates.length;
            return dates;
         ]]></body>
       </method>
 
       <property name="selectedDateTime">
@@ -2969,30 +2970,30 @@
         ]]></body>
       </method>
       <method name="setSelectedItems">
         <parameter name="aCount"/>
         <parameter name="aItems"/>
         <parameter name="aSuppressEvent"/>
         <body><![CDATA[
           if (this.mSelectedItems) {
-              for (var item of this.mSelectedItems) {
-                  for (var occ of this.getItemOccurrencesInView(item)) {
-                      var cols = this.findColumnsForItem(occ);
+              for (let item of this.mSelectedItems) {
+                  for (let occ of this.getItemOccurrencesInView(item)) {
+                      let cols = this.findColumnsForItem(occ);
                       for (let col of cols) {
                           col.header.unselectOccurrence(occ);
                           col.column.unselectOccurrence(occ);
                       }
                   }
               }
           }
           this.mSelectedItems = aItems || [];
 
-          for (var item of this.mSelectedItems) {
-              for (var occ of this.getItemOccurrencesInView(item)) {
+          for (let item of this.mSelectedItems) {
+              for (let occ of this.getItemOccurrencesInView(item)) {
                   let cols = this.findColumnsForItem(occ);
                   if (cols.length > 0) {
                       let start = item.startDate || item.entryDate || item.dueDate;
                       for (let col of cols) {
                           if (start.isDate) {
                               col.header.selectOccurrence(occ);
                           } else {
                               col.column.selectOccurrence(occ);
@@ -3066,17 +3067,17 @@
                   if (this.queryEndDate.compare(occEnd) < 0) {
                       occEnd = this.queryEndDate;
                   }
 
                   // Convert to display timezone if different
                   if (occStart.timezone != displayTZ) {
                       occStart = occStart.getInTimezone(displayTZ);
                   }
-                  if (occEnd.timezone != displayTZ) { 
+                  if (occEnd.timezone != displayTZ) {
                       occEnd = occEnd.getInTimezone(displayTZ);
                   }
                   // If crosses midnite in current TZ, set end just
                   // before midnite after start so start/title usually visible.
                   if (!sameDay(occStart, occEnd)) {
                       occEnd = occStart.clone();
                       occEnd.day = occStart.day;
                       occEnd.hour = 23;
@@ -3115,17 +3116,17 @@
         ]]></getter>
         <setter><![CDATA[
           this.mPixPerMin = val;
 
           let timebar = document.getAnonymousElementByAttribute(this, "anonid", "timebar");
           timebar.pixelsPerMinute = val;
 
           if (!this.mDateColumns) {
-              return;
+              return val;
           }
           for (let col of this.mDateColumns) {
               col.column.pixelsPerMinute = val;
           }
           return val;
         ]]></setter>
       </property>
 
@@ -3189,61 +3190,61 @@
               this.reorient();
 
           return ret;
         ]]></body>
       </method>
 
       <method name="reorient">
         <body><![CDATA[
-          var orient = this.getAttribute("orient");
-          var otherorient = "vertical";
+          let orient = this.getAttribute("orient");
+          let otherorient = "vertical";
           if (!orient) orient = "horizontal";
           if (orient == "vertical") otherorient = "horizontal";
 
           if (orient == "horizontal") {
               this.pixelsPerMinute = 1.5;
           } else {
               this.pixelsPerMinute = 0.6;
           }
 
-          var normalelems = ['mainbox', 'timebar'];
-          var otherelems = ['labelbox', 'labeldaybox', 'headertimespacer',
+          let normalelems = ['mainbox', 'timebar'];
+          let otherelems = ['labelbox', 'labeldaybox', 'headertimespacer',
                             'headerbox', 'headerdaybox', 'scrollbox', 'daybox'];
 
-          for (var id of normalelems) {
+          for (let id of normalelems) {
               document.getAnonymousElementByAttribute(this, "anonid", id).setAttribute("orient", orient);
           }
-          for (var id of otherelems) {
+          for (let id of otherelems) {
               document.getAnonymousElementByAttribute(this, "anonid", id).setAttribute("orient", otherorient);
           }
 
-          var scrollbox = document.getAnonymousElementByAttribute(
+          let scrollbox = document.getAnonymousElementByAttribute(
                          this, "anonid", "scrollbox");
-          var mainbox = document.getAnonymousElementByAttribute(
+          let mainbox = document.getAnonymousElementByAttribute(
                         this, "anonid", "mainbox");
 
           if (orient == "vertical") {
               scrollbox.setAttribute(
                   "style", "overflow-x: hidden; overflow-y: auto;");
               mainbox.setAttribute(
                   "style", "overflow-x: auto; overflow-y: hidden;");
           } else {
               scrollbox.setAttribute(
                   "style", "overflow-x: auto; overflow-y: hidden;");
               mainbox.setAttribute(
                   "style", "overflow-x: hidden; overflow-y: auto;");
           }
 
-          var boxes = ["daybox", "headerdaybox"];
-          for (var boxname of boxes) {
-              var box = document.getAnonymousElementByAttribute(this, "anonid", boxname);
+          let boxes = ["daybox", "headerdaybox"];
+          for (let boxname of boxes) {
+              let box = document.getAnonymousElementByAttribute(this, "anonid", boxname);
               setAttributeToChildren(box, "orient", orient);
           }
-          var box = document.getAnonymousElementByAttribute(this, "anonid", "labeldaybox");
+
           setAttributeToChildren(this.labeldaybox, "orient", otherorient);
 
           // Refresh
           this.refresh();
         ]]></body>
       </method>
 
       <method name="relayout">
@@ -3449,17 +3450,17 @@
           this.mToggleStatus = toggleStatus;
         ]]></body>
       </method>
 
       <method name="findColumnForDate">
         <parameter name="aDate"/>
         <body><![CDATA[
           if (!this.mDateColumns) {
-              return;
+              return null;
           }
           for (var col of this.mDateColumns) {
               if (col.date.compare(aDate) == 0)
                   return col;
           }
           return null;
         ]]></body>
       </method>
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -90,17 +90,17 @@ function handleTaskContextMenuStateChang
 }
 
 /**
  * Change the opening menu for the selected tasks.
  *
  * @param aEvent    The popupshowing event of the opening menu.
  */
 function changeMenuForTask(aEvent) {
-    // Make sure to update the status of some commands. 
+    // Make sure to update the status of some commands.
     ["calendar_delete_todo_command",
      "calendar_toggle_completed_command",
      "calendar_general-progress_command",
      "calendar_general-priority_command",
      "calendar_general-postpone_command"].forEach(goUpdateCommand);
 
     let tasks = getSelectedTasks(aEvent);
     let tasksSelected = (tasks.length > 0);
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -1184,17 +1184,17 @@
             <body><![CDATA[
               let initialDate = agendaListbox.today ? agendaListbox.today.start : now();
               return initialDate ? initialDate : now();
             ]]></body>
       </method>
       <method name="updateFilter">
         <parameter name="aFilter"/>
         <body><![CDATA[
-            this.mFilter.selectedDate = agendaListbox.today && agendaListbox.today.start ? 
+            this.mFilter.selectedDate = agendaListbox.today && agendaListbox.today.start ?
                                         agendaListbox.today.start : now();
 
             this.doUpdateFilter(aFilter);
         ]]></body>
       </method>
-    </implementation>    
+    </implementation>
   </binding>
 </bindings>
--- a/calendar/base/content/calendar-task-view.js
+++ b/calendar/base/content/calendar-task-view.js
@@ -68,17 +68,17 @@ var taskDetailsView = {
                         statusDetails.value = calGetString(
                             "calendar",
                             "taskDetailsStatusNeedsAction");
                         break;
                     case "IN-PROCESS":
                         var percent = 0;
                         var property = item.getProperty("PERCENT-COMPLETE");
                         if (property != null) {
-                            var percent = parseInt(property);
+                            percent = parseInt(property, 10);
                         }
                         statusDetails.value = calGetString(
                             "calendar",
                             "taskDetailsStatusInProgress", [percent]);
                         break;
                     case "COMPLETED":
                         if (item.completedDate) {
                             var completedDate = item.completedDate.getInTimezone(
--- a/calendar/base/content/calendar-unifinder-todo.js
+++ b/calendar/base/content/calendar-unifinder-todo.js
@@ -19,17 +19,17 @@ function prepareCalendarToDoUnifinder() 
  */
 function updateCalendarToDoUnifinder(aFilter) {
     // Set up hiding completed tasks for the unifinder-todo tree
     let showCompleted = document.getElementById("show-completed-checkbox").checked;
     let tree = document.getElementById("unifinder-todo-tree");
     let oldFilter = document.getElementById("unifinder-todo-filter-broadcaster").getAttribute("value");
     let filter = oldFilter;
 
-    // This function acts as an event listener, in which case we get the Event as the 
+    // This function acts as an event listener, in which case we get the Event as the
     // parameter instead of a filter.
     if (aFilter && !(aFilter instanceof Event)) {
         filter = aFilter;
     }
 
     if (filter && (filter != oldFilter)) {
         document.getElementById("unifinder-todo-filter-broadcaster").setAttribute("value", aFilter);
     }
--- a/calendar/base/content/calendar-view-core.xml
+++ b/calendar/base/content/calendar-view-core.xml
@@ -78,17 +78,17 @@
          this.eventNameTextbox.onkeypress = function onKeyPress(event) {
              // save on enter
              if (event.keyCode == 13)
                  self.stopEditing(true);
              // abort on escape
              else if (event.keyCode == 27)
                  self.stopEditing(false);
          };
-         function stopPropagationIfEditing(event) { 
+         function stopPropagationIfEditing(event) {
            if (self.mEditing) {
              event.stopPropagation();
            }
          }
          // while editing, single click positions cursor, so don't propagate.
          this.eventNameTextbox.onclick = stopPropagationIfEditing;
          // while editing, double click selects words, so don't propagate.
          this.eventNameTextbox.ondblclick = stopPropagationIfEditing;
@@ -153,17 +153,17 @@
           var item = this.mOccurrence;
           evl.value = (item.title ? item.title.replace(/\n/g, ' ') :
                                     cal.calGetString("calendar", "eventUntitled"));
         ]]></body>
       </method>
 
       <method name="setCSSClasses">
         <body><![CDATA[
-          var item = this.mOccurrence;          
+          var item = this.mOccurrence;
           this.setAttribute("calendar-uri", item.calendar.uri.spec);
           this.setAttribute("calendar-id", item.calendar.id);
           var categoriesArray = item.getCategories({});
           if (categoriesArray.length > 0) {
             var cssClassesArray = categoriesArray.map(formatStringForCSSRule);
             this.setAttribute("categories", cssClassesArray.join(" "));
           }
 
@@ -262,17 +262,17 @@
       </method>
       <method name="select">
         <parameter name="event"/>
         <body><![CDATA[
             if (!this.calendarView) {
                 return;
             }
             let items = this.calendarView.mSelectedItems.slice();
-            if (event.ctrlKey || event.metaKey) {    
+            if (event.ctrlKey || event.metaKey) {
                 if (this.selected) {
                     let pos = items.indexOf(this.mOccurrence);
                     items.splice(pos, 1);
                 } else {
                     items.push(this.mOccurrence);
                 }
             } else {
                 items = [this.mOccurrence];
@@ -284,17 +284,17 @@
         <parameter name="saveChanges"/>
         <body><![CDATA[
           if (!this.mEditing)
             return;
 
           this.mEditing = false;
 
           if (saveChanges && (this.eventNameTextbox.value != this.mOriginalTextLabel)) {
-              this.calendarView.controller.modifyOccurrence(this.mOccurrence, 
+              this.calendarView.controller.modifyOccurrence(this.mOccurrence,
                                                             null, null,
                                                             this.eventNameTextbox.value);
 
               // Note that as soon as we do the modifyItem, this element ceases to exist,
               // so don't bother trying to modify anything further here! ('this' exists,
               // because it's being kept alive, but our child content etc. is all gone)
               return;
           }
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -111,31 +111,33 @@ var calendarViewController = {
         // Make sure we are modifying a copy of aOccurrences, otherwise we will
         // run into race conditions when the view's doDeleteItem removes the
         // array elements while we are iterating through them. While we are at
         // it, filter out any items that have readonly calendars, so that
         // checking for one total item below also works out if all but one item
         // are readonly.
         var occurrences = aOccurrences.filter(function(item) { return isCalendarWritable(item.calendar); });
 
-        for (var itemToDelete of occurrences) {
+        for (let itemToDelete of occurrences) {
             if (aUseParentItems) {
                 // Usually happens when ctrl-click is used. In that case we
                 // don't need to ask the user if he wants to delete an
                 // occurrence or not.
                 itemToDelete = itemToDelete.parentItem;
             } else if (!aDoNotConfirm && occurrences.length == 1) {
                 // Only give the user the selection if only one occurrence is
                 // selected. Otherwise he will get a dialog for each occurrence
                 // he deletes.
-                var [itemToDelete, hasFutureItem, response] = promptOccurrenceModification(itemToDelete, false, "delete");
+                let [targetItem, hasFutureItem, response] = promptOccurrenceModification(itemToDelete, false, "delete");
                 if (!response) {
                     // The user canceled the dialog, bail out
                     break;
                 }
+
+                itemToDelete = targetItem;
             }
 
             // Now some dirty work: Make sure more than one occurrence can be
             // deleted by saving the recurring items and removing occurrences as
             // they come in. If this is not an occurrence, we can go ahead and
             // delete the whole item.
             if (itemToDelete.parentItem.hashId != itemToDelete.hashId) {
                 var savedItem = getSavedItem(itemToDelete);
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -259,17 +259,17 @@ function matchCustomReminderToMenuitem(r
         }
     }
 
     return false;
 }
 /**
  * Load an item's reminders into the dialog
  *
- * @param reminders     An array of calIAlarms to load. 
+ * @param reminders     An array of calIAlarms to load.
  */
 function loadReminders(reminders) {
     // select 'no reminder' by default
     let reminderList = document.getElementById("item-alarm");
     let reminderPopup = reminderList.firstChild;
     let customItem = document.getElementById("reminder-custom-menuitem");
     reminderList.selectedIndex = 0;
     gLastAlarmSelection = 0;
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
@@ -236,18 +236,18 @@ function propagateDateTime() {
  * variables to be initialized. It updates the date/time information displayed in
  * the dialog from the above noted variables.
  */
 function updateDateTime() {
     // Convert to default timezone if the timezone option
     // is *not* checked, otherwise keep the specific timezone
     // and display the labels in order to modify the timezone.
     if (gDisplayTimezone) {
-        var startTime = gStartDate.getInTimezone(gStartTimezone);
-        var endTime = gEndDate.getInTimezone(gEndTimezone);
+        let startTime = gStartDate.getInTimezone(gStartTimezone);
+        let endTime = gEndDate.getInTimezone(gEndTimezone);
 
         if (startTime.isDate) {
             document.getElementById("all-day")
                 .setAttribute("checked", "true");
         }
 
         // In the case where the timezones are different but
         // the timezone of the endtime is "UTC", we convert
@@ -264,20 +264,20 @@ function updateDateTime() {
         // to set the timezone to 'floating' in order to avoid the
         // automatic conversion back into the OS timezone.
         startTime.timezone = floating();
         endTime.timezone = floating();
 
         document.getElementById("event-starttime").value = cal.dateTimeToJsDate(startTime);
         document.getElementById("event-endtime").value = cal.dateTimeToJsDate(endTime);
     } else {
-        var kDefaultTimezone = calendarDefaultTimezone();
+        let kDefaultTimezone = calendarDefaultTimezone();
 
-        var startTime = gStartDate.getInTimezone(kDefaultTimezone);
-        var endTime = gEndDate.getInTimezone(kDefaultTimezone);
+        let startTime = gStartDate.getInTimezone(kDefaultTimezone);
+        let endTime = gEndDate.getInTimezone(kDefaultTimezone);
 
         if (startTime.isDate) {
             document.getElementById("all-day")
                 .setAttribute("checked", "true");
         }
 
         // Before feeding the date/time value into the control we need
         // to set the timezone to 'floating' in order to avoid the
@@ -350,17 +350,17 @@ function updateStartTime() {
     let startWidget = document.getElementById(startWidgetId);
     let endWidget = document.getElementById(endWidgetId);
 
     // jsDate is always in OS timezone, thus we create a calIDateTime
     // object from the jsDate representation and simply set the new
     // timezone instead of converting.
     let timezone = gDisplayTimezone ? gStartTimezone : calendarDefaultTimezone();
     let start = cal.jsDateToDateTime(startWidget.value, timezone);
-                                    
+
     gStartDate = start.clone();
     start.addDuration(gDuration);
     gEndDate = start.getInTimezone(gEndTimezone);
 
     let allDayElement = document.getElementById("all-day");
     let allDay = allDayElement.getAttribute("checked") == "true";
     if (allDay) {
         gStartDate.isDate = true;
@@ -579,34 +579,34 @@ function changeAllDay() {
  * Handler function used when the window is resized.
  */
 function onResize() {
     // Don't do anything if we haven't been initialized.
     if (!gStartDate || !gEndDate) {
         return;
     }
 
-    var grid = document.getElementById("freebusy-grid");
-    var gridScrollbar = document.getElementById("horizontal-scrollbar");
+    let grid = document.getElementById("freebusy-grid");
+    let gridScrollbar = document.getElementById("horizontal-scrollbar");
     grid.fitDummyRows();
-    var ratio = grid.boxObject.width / grid.documentSize;
-    var maxpos = gridScrollbar.getAttribute("maxpos");
-    var inc = maxpos * ratio / (1 - ratio);
-    gridScrollbar.setAttribute("pageincrement", inc);
+    let gridRatio = grid.boxObject.width / grid.documentSize;
+    let gridMaxpos = gridScrollbar.getAttribute("maxpos");
+    let gridInc = gridMaxpos * gridRatio / (1 - gridRatio);
+    gridScrollbar.setAttribute("pageincrement", gridInc);
 
-    var attendees = document.getElementById("attendees-list");
-    var attendeesScrollbar = document.getElementById("vertical-scrollbar");
-    var box = document.getElementById("vertical-scrollbar-box");
+    let attendees = document.getElementById("attendees-list");
+    let attendeesScrollbar = document.getElementById("vertical-scrollbar");
+    let box = document.getElementById("vertical-scrollbar-box");
     attendees.fitDummyRows();
-    var ratio = attendees.boxObject.height / attendees.documentSize;
-    if (ratio < 1) {
+    let attRatio = attendees.boxObject.height / attendees.documentSize;
+    let attMaxpos = attendeesScrollbar.getAttribute("maxpos");
+    if (attRatio < 1) {
         box.removeAttribute("collapsed");
-        var maxpos = attendeesScrollbar.getAttribute("maxpos");
-        var inc = maxpos * ratio / (1 - ratio);
-        attendeesScrollbar.setAttribute("pageincrement", inc);
+        let attInc = attMaxpos * attRatio / (1 - attRatio);
+        attendeesScrollbar.setAttribute("pageincrement", attInc);
     } else {
         box.setAttribute("collapsed", "true");
     }
 }
 
 /**
  * Handler function to call when changing the calendar used in this dialog.
  *
@@ -744,17 +744,17 @@ function scrollToCurrentTime() {
 
 /**
  * Sets the zoom factor for the time grid
  *
  * @param aValue        The zoom factor to set.
  * @return              aValue (for chaining)
  */
 function setZoomFactor(aValue) {
-    // Correct zoom factor, if needed 
+    // Correct zoom factor, if needed
     aValue = parseInt(aValue, 10) || 100;
 
     if (gZoomFactor == aValue) {
         return aValue;
     }
 
     gZoomFactor = aValue;
     applyCurrentZoomFactor();
@@ -881,58 +881,58 @@ function onMouseScroll(event) {
 
 /**
  * Hanlder function to take care of attribute changes on the window
  *
  * @param event     The DOMAttrModified event caused by this change.
  */
 function onAttrModified(event) {
     if (event.attrName == "width") {
-        var selectionbar = document.getElementById("selection-bar");
+        let selectionbar = document.getElementById("selection-bar");
         selectionbar.setWidth(selectionbar.boxObject.width);
         return;
     }
 
     // Synchronize grid and attendee list
-    var target = event.originalTarget;
+    let target = event.originalTarget;
     if (target.hasAttribute("anonid") &&
         target.getAttribute("anonid") == "input" &&
         event.attrName == "focused") {
-        var attendees = document.getElementById("attendees-list");
+        let attendees = document.getElementById("attendees-list");
         if (event.newValue == "true") {
             let grid = document.getElementById("freebusy-grid");
             if (grid.firstVisibleRow != attendees.firstVisibleRow) {
                 grid.firstVisibleRow = attendees.firstVisibleRow;
             }
         }
         if (!target.lastListCheckedValue
             || target.lastListCheckedValue != target.value) {
             attendees.resolvePotentialList(target);
             target.lastListCheckedValue = target.value;
         }
     }
 
     if (event.originalTarget.localName == "scrollbar") {
-        var scrollbar = event.originalTarget;
+        let scrollbar = event.originalTarget;
         if (scrollbar.hasAttribute("maxpos")) {
             if (scrollbar.getAttribute("id") == "vertical-scrollbar") {
-                var attendees = document.getElementById("attendees-list");
-                var grid = document.getElementById("freebusy-grid");
+                let attendees = document.getElementById("attendees-list");
+                let grid = document.getElementById("freebusy-grid");
                 if (event.attrName == "curpos") {
-                    var maxpos = scrollbar.getAttribute("maxpos");
+                    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") {
-                    var maxpos = scrollbar.getAttribute("maxpos");
-                    var ratio = event.newValue/maxpos;
-                    var timebar = document.getElementById("timebar");
-                    var grid = document.getElementById("freebusy-grid");
-                    var selectionbar = document.getElementById("selection-bar");
+                    let maxpos = scrollbar.getAttribute("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
@@ -1420,17 +1420,17 @@
           this.mMargin = start_offset_in_hours * hour_width;
 
           // Calculate the difference between content and container in pixels.
           // The container is the window showing this control, the content is the
           // total number of pixels the selection bar can theoretically take up.
           var total_width = this.mContentWidth * this.mRange - this.parentNode.boxObject.width;
 
           // Calculate the current scroll offset.
-          var offset = Math.floor(total_width * this.mRatio);
+          offset = Math.floor(total_width * this.mRatio);
 
           // The final margin is the difference between the date-based margin
           // and the scroll-based margin.
           this.mMargin -= offset;
 
           // Set the styles based on the calculations above for the 'selection-bar'.
           var style = "width: " + this.mWidth +
                       "px; margin-inline-start: " + this.mMargin +
@@ -1548,18 +1548,18 @@
             }
         }
       ]]></handler>
 
       <handler event="mousemove"><![CDATA[
         var mouseX = event.screenX;
         if (this.mDragState == 1) {
             // Move the startdate and the enddate
-            var delta = mouseX - this.mMouseX;
-            var newStart = this.moveTime(this.mStartDate, delta, false);
+            let delta = mouseX - this.mMouseX;
+            let newStart = this.moveTime(this.mStartDate, delta, false);
             if (newStart.compare(this.mStartDate) != 0) {
                 newEnd = this.moveTime(this.mEndDate, delta, false);
 
                 // We need to adapt this date in case we're dealing with
                 // an all-day event. This is because setting 'endDate' will
                 // automatically add one day extra for all-day events.
                 if (newEnd.isDate) {
                     newEnd.day--;
@@ -1567,35 +1567,35 @@
 
                 this.startDate = newStart;
                 this.endDate = newEnd;
                 this.mMouseX = mouseX;
                 this.update();
             }
         } else if (this.mDragState == 2) {
             // Move the startdate only...
-            var delta = event.screenX - this.mSelectionbar.boxObject.screenX;
-            var newStart = this.moveTime(this.mStartDate, delta, true);
+            let delta = event.screenX - this.mSelectionbar.boxObject.screenX;
+            let newStart = this.moveTime(this.mStartDate, delta, true);
             if (newStart.compare(this.mEndDate) >= 0) {
                 if (!this.mStartDate.isDate) {
                     newStart = this.mEndDate;
                 }
                 else{
                     return;
                 }
             }
             if (newStart.compare(this.mStartDate) != 0) {
                 this.startDate = newStart;
                 this.update();
             }
         } else if (this.mDragState == 3) {
             // Move the enddate only..
-            var delta = mouseX - (this.mSelectionbar.boxObject.screenX +
+            let delta = mouseX - (this.mSelectionbar.boxObject.screenX +
                                   this.mSelectionbar.boxObject.width);
-            var newEnd = this.moveTime(this.mEndDate, delta, true);
+            let newEnd = this.moveTime(this.mEndDate, delta, true);
             if (newEnd.compare(this.mStartDate) < 0) {
                 newEnd = this.mStartDate;
             }
             if (newEnd.compare(this.mEndDate) != 0) {
                 // We need to adapt this date in case we're dealing with
                 // an all-day event. This is because setting 'endDate' will
                 // automatically add one day extra for all-day events.
                 if (newEnd.isDate) {
--- a/calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
@@ -163,40 +163,40 @@
               this.mDateFormatter =
                   Components.classes[
                       "@mozilla.org/calendar/datetime-formatter;1"]
                           .getService(
                               Components.interfaces.calIDateTimeFormatter);
           }
 
           // First set the formatted date string as title
-          var day =
+          let day =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "day");
-          var value = (this.mZoomFactor > 100) ?
+          let value = (this.mZoomFactor > 100) ?
               this.mDateFormatter.formatDateShort(date) :
               this.mDateFormatter.formatDateLong(date);
           day.setAttribute("value", value);
 
           // Now create as many 'hour' elements as needed
-          var step_in_minutes = Math.floor(60 * this.mZoomFactor / 100);
-          var hours =
+          let step_in_minutes = Math.floor(60 * this.mZoomFactor / 100);
+          let hours =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "hours");
           date.hour = this.mStartHour;
           if (hours.childNodes.length <= 0) {
-              var template = createXULElement("text");
+              let template = createXULElement("text");
               template.className = "freebusy-timebar-hour";
-              var count = Math.ceil(
+              let count = Math.ceil(
                   (this.mEndHour - this.mStartHour) * 60 / step_in_minutes);
-              var remain = count;
+              let remain = count;
               let first = true;
               while (remain--) {
-                  var newNode = template.cloneNode(false);
-                  var value = this.mDateFormatter.formatTime(date);
+                  let newNode = template.cloneNode(false);
+                  let value = this.mDateFormatter.formatTime(date);
                   if (first) {
                       newNode.className += " first-in-day";
                       first = false;
                   }
                   newNode.setAttribute("value", value);
                   hours.appendChild(newNode);
                   date.minute += step_in_minutes;
 
@@ -1345,19 +1345,19 @@
           // Now iterate all freebusy-rows and ask each one
           // if it wants to modify the suggested time slot.
           // we keep iterating the rows until all of them
           // are happy with it.
           var recheck;
           do {
               recheck = false;
 
-              for (var i = 1; i <= this.mMaxFreeBusy; i++) {
+              for (let i = 1; i <= this.mMaxFreeBusy; i++) {
                   var row = this.getFreeBusyElement(i);
-                  var newTime = row.nextSlot(startTime, endTime, allDay);
+                  let newTime = row.nextSlot(startTime, endTime, allDay);
                   if (newTime) {
                     if (newTime.compare(startTime) != 0) {
                         startTime = newTime;
 
                         if (startTime.hour < this.mStartHour) {
                             startTime.hour = this.mStartHour;
                             startTime.minute = 0;
                         }
@@ -1396,18 +1396,18 @@
               startTime.isDate = true;
           }
 
           // In case the new starttime happens to be scheduled
           // on a different day, we also need to update the
           // complete freebusy informations and appropriate
           // underlying arrays holding the informaion.
           if (this.mStartDate.day != startTime.day) {
-              for (var i = 1; i <= this.mMaxFreeBusy; i++) {
-                  var row = this.getFreeBusyElement(i);
+              for (let i = 1; i <= this.mMaxFreeBusy; i++) {
+                  let row = this.getFreeBusyElement(i);
                   row.setAttribute("dirty", "true");
               }
               this.updateFreeBusy();
           }
 
           // Return the new starttime of the item.
           return startTime;
         ]]></body>
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
@@ -5,17 +5,17 @@
 
 <bindings xmlns="http://www.mozilla.org/xbl"
           xmlns:xbl="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="recurrence-preview" extends="xul:box">
     <resources>
       <stylesheet src="chrome://calendar/content/widgets/calendar-widget-bindings.css"/>
-    </resources>               
+    </resources>
     <content>
       <xul:box flex="1" style="overflow: hidden;">
         <xul:grid flex="1" anonid="mainbox">
           <xul:columns>
             <xul:column anonid="column"/>
             <xul:column flex="1"/>
           </xul:columns>
           <xul:rows>
@@ -103,17 +103,17 @@
           var rowIterator = row;
           while (rowIterator) {
               numRows++;
               rowIterator = rowIterator.nextSibling;
           }
 
           // Adjust rows
           while (numRows < numVertical) {
-              var newNode = row.cloneNode(true);
+              let newNode = row.cloneNode(true);
               rows.appendChild(newNode);
               numRows++;
           }
           while (numRows > numVertical) {
               rows.firstChild.remove();
               numRows--
           }
 
@@ -131,17 +131,17 @@
           }
 
           // Walk all rows and adjust column elements
           row = document.getAnonymousElementByAttribute(
                    this, "anonid", "row");
           while (row) {
               var firstChild = row.firstChild;
               while ((row.childNodes.length - 1) < numHorizontal) {
-                  var newNode = firstChild.cloneNode(true);
+                  let newNode = firstChild.cloneNode(true);
                   firstChild.parentNode.insertBefore(newNode, firstChild);
               }
               while ((row.childNodes.length - 1) > numHorizontal) {
                   row.firstChild.remove();
               }
               row = row.nextSibling;
           }
 
@@ -173,41 +173,41 @@
           this.mRecurrenceInfo = aRecurrenceInfo;
           var start = this.dateTime.clone();
           start.day = 1;
           start.hour = 0;
           start.minute = 0;
           start.second = 0;
           var end = start.clone();
           end.month++;
-                      
+
           // the 'minimonth' controls are arranged in a
           // grid, sorted by rows first -> iterate the rows that may exist.
           var row = document.getAnonymousElementByAttribute(this, "anonid", "row");
           while (row) {
-          
+
               // now iterater all the child nodes of this row
               // in order to visit each minimonth in turn.
               var numChilds = row.childNodes.length - 1;
               for (var i = 0; i < numChilds; i++) {
-              
+
                   // we now have one of the minimonth controls while 'start'
                   // and 'end' are set to the interval this minimonth shows.
                   var minimonth = row.childNodes[i];
                   minimonth.showMonth(cal.dateTimeToJsDate(start));
                   if (aRecurrenceInfo) {
-                      
+
                       // retrieve an array of dates that represents all occurrences
                       // that fall into this time interval [start,end[.
                       // note: the following loop assumes that this array conains
                       // dates that are strictly monotonically increasing.
                       // should getOccurrenceDates() not enforce this assumption we
                       // need to fall back to some different algorithm.
                       var dates = aRecurrenceInfo.getOccurrenceDates(start, end, 0, {});
-                      
+
                       // now run throgh all days of this month and set the
                       // 'busy' attribute with respect to the occurrence array.
                       var index = 0;
                       var occurrence = null;
                       if (index < dates.length) {
                           occurrence =
                               dates[index++]
                                   .getInTimezone(start.timezone);
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -280,31 +280,31 @@ function onSave(item) {
         recurrenceInfo = createRecurrenceInfo(item);
     }
 
     var recRule = createRecurrenceRule();
     const ALL_WEEKDAYS = [2,3,4,5,6,7,1]; // The sequence MO,TU,WE,TH,FR,SA,SU.
     switch (deckNumber) {
     case 0:
         recRule.type = "DAILY";
-        var dailyGroup = document.getElementById("daily-group");
+        let dailyGroup = document.getElementById("daily-group");
         if (dailyGroup.selectedIndex == 0) {
-            var ndays = Math.max(1, Number(getElementValue("daily-days")));
+            let ndays = Math.max(1, Number(getElementValue("daily-days")));
             recRule.interval = ndays;
         } else {
             recRule.interval = 1;
-            var onDays = [2, 3, 4, 5, 6];
+            let onDays = [2, 3, 4, 5, 6];
             recRule.setComponent("BYDAY", onDays.length, onDays);
         }
         break;
     case 1:
         recRule.type = "WEEKLY";
-        var ndays = Number(getElementValue("weekly-weeks"));
+        let ndays = Number(getElementValue("weekly-weeks"));
         recRule.interval = ndays;
-        var onDays = document.getElementById("daypicker-weekday").days;
+        let onDays = document.getElementById("daypicker-weekday").days;
         if (onDays.length > 0) {
             recRule.setComponent("BYDAY", onDays.length, onDays);
         }
         break;
     case 2:
         recRule.type = "MONTHLY";
         var monthInterval = Number(getElementValue("monthly-interval"));
         recRule.interval = monthInterval;
@@ -329,29 +329,29 @@ function onSave(item) {
             var monthlyDays = document.getElementById("monthly-days").days;
             if (monthlyDays.length > 0) {
                 recRule.setComponent("BYMONTHDAY", monthlyDays.length, monthlyDays);
             }
         }
         break;
     case 3:
         recRule.type = "YEARLY";
-        var yearInterval = Number(getElementValue("yearly-interval"));
+        let yearInterval = Number(getElementValue("yearly-interval"));
         recRule.interval = yearInterval;
-        var yearlyGroup = document.getElementById("yearly-group");
+        let yearlyGroup = document.getElementById("yearly-group");
         if (yearlyGroup.selectedIndex == 0) {
-            var yearlyByMonth = [ Number(getElementValue("yearly-month-ordinal")) ];
+            let yearlyByMonth = [ Number(getElementValue("yearly-month-ordinal")) ];
             recRule.setComponent("BYMONTH", yearlyByMonth.length, yearlyByMonth);
-            var yearlyByDay = [ Number(getElementValue("yearly-days")) ];
+            let yearlyByDay = [ Number(getElementValue("yearly-days")) ];
             recRule.setComponent("BYMONTHDAY", yearlyByDay.length, yearlyByDay);
         } else {
-            var yearlyByMonth = [ Number(getElementValue("yearly-month-rule")) ];
+            let yearlyByMonth = [ Number(getElementValue("yearly-month-rule")) ];
             recRule.setComponent("BYMONTH", yearlyByMonth.length, yearlyByMonth);
-            var ordinal = Number(getElementValue("yearly-ordinal"));
-            var day_of_week = Number(getElementValue("yearly-weekday"));
+            let ordinal = Number(getElementValue("yearly-ordinal"));
+            let day_of_week = Number(getElementValue("yearly-weekday"));
             if (day_of_week < 0) {
                 if (ordinal == 0) {
                     // Yearly rule "Every day of a month".
                     recRule.setComponent("BYDAY", 7, ALL_WEEKDAYS);
                 } else {
                     // One of the first five days or the last of a month.
                     recRule.setComponent("BYMONTHDAY", 1, [ ordinal ]);
                 }
@@ -742,17 +742,16 @@ function updateRecurrencePattern() {
  * @param aPropKey      The locale property key to get the order from
  * @param aPropParams   An array of ids to be passed to the locale property.
  *                        These should be the ids of the elements to change
  *                        the order for.
  */
 function changeOrderForElements(aPropKey, aPropParams) {
     var localeOrder;
     var parents = {};
-    var i = 0;
 
     for (var key in aPropParams) {
         // Save original parents so that the nodes to reorder get appended to
         // the correct parent nodes.
         parents[key] = document.getElementById(aPropParams[key]).parentNode;
     }
 
     try {
@@ -765,17 +764,17 @@ function changeOrderForElements(aPropKey
         var s = "The key " + aPropKey + " in calendar-event-dialog.prop" +
                 "erties has incorrect number of params. Expected " +
                 aPropParams.length + " params.";
         Components.utils.reportError(s + " " + ex);
         return;
     }
 
     // Add elements in the right order, removing them from their old parent
-    for (var i = 0; i < aPropParams.length; i++) {
+    for (let i = 0; i < aPropParams.length; i++) {
         var newEl = document.getElementById(localeOrder[i]);
         if (newEl) {
             parents[i].appendChild(newEl.parentNode.removeChild(newEl));
         } else {
             cal.ERROR("Localization error, could not find node '" + localeOrder[i] + "'. Please have your localizer check the string '" + aPropKey + "'");
         }
     }
 }
--- a/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
 Components.utils.import("resource://calendar/modules/calIteratorUtils.jsm");
 Components.utils.import("resource://gre/modules/PluralForm.jsm");
 Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-var allowedActionsMap = {}; 
+var allowedActionsMap = {};
 
 /**
  * Sets up the reminder dialog.
  */
 function onLoad() {
     let calendar = window.arguments[0].calendar;
 
     // Make sure the origin menulist uses the right labels, depending on if the
@@ -158,20 +158,20 @@ function setupMaxReminders() {
 
     // != null is needed here to ensure cond to be true/false, instead of
     // true/null. The former is needed for setElementValue.
     let cond = (maxReminders != null && listbox.childNodes.length >= maxReminders);
 
     // If we hit the maximum number of reminders, show the error box and
     // disable the new button.
     setElementValue("reminder-new-button", cond && "true", "disabled");
-    
+
     if (!setupMaxReminders.notification) {
         let notification = createXULElement("notification");
-        let localeErrorString = 
+        let localeErrorString =
             calGetString("calendar-alarms",
                          getItemBundleStringName("reminderErrorMaxCountReached"),
                          [maxReminders]);
         let pluralErrorLabel = PluralForm.get(maxReminders, localeErrorString)
                                          .replace("#1", maxReminders);
 
         notification.setAttribute("label", pluralErrorLabel);
         notification.setAttribute("type", "warning");
--- a/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
@@ -8,58 +8,58 @@ Components.utils.import("resource://cale
  * Sets up the timezone dialog from the window arguments, also setting up all
  * dialog controls from the window's dates.
  */
 function onLoad() {
     var args = window.arguments[0];
     window.time = args.time;
     window.onAcceptCallback = args.onOk;
 
-    var tzProvider = (args.calendar.getProperty("timezones.provider") ||
+    let tzProvider = (args.calendar.getProperty("timezones.provider") ||
                       cal.getTimezoneService());
     window.tzProvider = tzProvider;
 
-    var menulist = document.getElementById("timezone-menulist");
-    var tzMenuPopup = document.getElementById("timezone-menupopup");
+    let menulist = document.getElementById("timezone-menulist");
+    let tzMenuPopup = document.getElementById("timezone-menupopup");
 
     // floating and UTC (if supported) at the top:
     if (args.calendar.getProperty("capabilities.timezones.floating.supported") !== false) {
         addMenuItem(tzMenuPopup, floating().displayName, floating().tzid);
     }
     if (args.calendar.getProperty("capabilities.timezones.UTC.supported") !== false) {
         addMenuItem(tzMenuPopup, UTC().displayName, UTC().tzid);
     }
 
-    var enumerator = tzProvider.timezoneIds;
-    var tzids = {};
-    var displayNames = [];
+    let enumerator = tzProvider.timezoneIds;
+    let tzids = {};
+    let displayNames = [];
     while (enumerator.hasMore()) {
-        var tz = tzProvider.getTimezone(enumerator.getNext());
+        let tz = tzProvider.getTimezone(enumerator.getNext());
         if (tz && !tz.isFloating && !tz.isUTC) {
-            var displayName = tz.displayName;
+            let displayName = tz.displayName;
             displayNames.push(displayName);
             tzids[displayName] = tz.tzid;
         }
     }
     // the display names need to be sorted
     displayNames.sort(String.localeCompare);
-    for (var i = 0; i < displayNames.length; ++i) {
-        var displayName = displayNames[i];
+    for (let i = 0; i < displayNames.length; ++i) {
+        let displayName = displayNames[i];
         addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
     }
 
-    var index = findTimezone(window.time.timezone);
+    let index = findTimezone(window.time.timezone);
     if (index < 0) {
         index = findTimezone(calendarDefaultTimezone());
         if (index < 0) {
             index = 0;
         }
     }
 
-    var menulist = document.getElementById("timezone-menulist");
+    menulist = document.getElementById("timezone-menulist");
     menulist.selectedIndex = index;
 
     updateTimezone();
 
     opener.setCursor("auto");
 }
 
 /**
--- a/calendar/base/content/dialogs/calendar-invitations-list.xml
+++ b/calendar/base/content/dialogs/calendar-invitations-list.xml
@@ -64,16 +64,27 @@
 
     <implementation>
       <!-- fields -->
       <field name="mDateFormatter">null</field>
       <field name="mCalendarItem">null</field>
       <field name="mInitialParticipationStatus">null</field>
       <field name="mParticipationStatus">null</field>
 
+      <property name="mStrings">
+        <getter>return {
+            alldayEvent: "&calendar.invitations.list.alldayevent.text;",
+            recurrentEvent: "&calendar.invitations.list.recurrentevent.text;",
+            location: "&calendar.invitations.list.location.text;",
+            organizer: "&calendar.invitations.list.organizer.text;",
+            attendee: "&calendar.invitations.list.attendee.text;",
+            none: "&calendar.invitations.list.none.text;"
+        };</getter>
+      </property>
+
       <!-- properties -->
       <property name="calendarItem">
         <getter><![CDATA[
           return this.mCalendarItem;
         ]]></getter>
         <setter><![CDATA[
           this.setCalendarItem(val);
           return val;
@@ -107,79 +118,72 @@
       <constructor><![CDATA[
         Components.utils.import("resource://calendar/modules/calUtils.jsm");
         this.mDateFormatter = getDateFormatter();
       ]]></constructor>
 
       <!-- methods -->
       <method name="setCalendarItem">
         <parameter name="aItem"/>
-        <body>
-          var alldayEventText = "&calendar.invitations.list.alldayevent.text;";
-          var recurrentEventText = "&calendar.invitations.list.recurrentevent.text;";
-          var locationText = "&calendar.invitations.list.location.text;";
-          var organizerText = "&calendar.invitations.list.organizer.text;";
-          var attendeeText = "&calendar.invitations.list.attendee.text;";
-          var noneText = "&calendar.invitations.list.none.text;";
-          <![CDATA[
+        <body><![CDATA[
             this.mCalendarItem = aItem;
             this.mInitialParticipationStatus =
                 this.getCalendarItemParticipationStatus(aItem);
             this.participationStatus = this.mInitialParticipationStatus;
 
             var titleLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "title");
             titleLabel.setAttribute("value", aItem.title);
 
             var dateLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "date");
             var dateString = this.mDateFormatter.formatItemInterval(aItem);
             if (aItem.startDate.isDate) {
-                dateString += ", " + alldayEventText;
+                dateString += ", " + this.mStrings.alldayEvent;
             }
             dateLabel.setAttribute("value", dateString);
 
             var recurrenceLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "recurrence");
             if (aItem.recurrenceInfo) {
-                recurrenceLabel.setAttribute("value", recurrentEventText);
+                recurrenceLabel.setAttribute("value", this.mStrings.recurrentEvent);
             } else {
                 recurrenceLabel.setAttribute("hidden", "true");
                 var spacer = document.getAnonymousElementByAttribute(
                     this, "anonid", "spacer");
                 spacer.removeAttribute("hidden");
             }
 
             var locationLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "location");
-            var locationString = locationText;
+            var locationString = this.mStrings.location;
             var locationProperty = aItem.getProperty("LOCATION");
             if (locationProperty && locationProperty.length > 0) {
                 locationString += locationProperty;
             } else {
-                locationString += noneText;
+                locationString += this.mStrings.none;
             }
             locationLabel.setAttribute("value", locationString);
 
             var organizerLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "organizer");
-            var organizerString = organizerText;
+            var organizerString = this.mStrings.organizer;
             var org = aItem.organizer;
             if (org) {
                 if (org.commonName && org.commonName.length > 0) {
                     organizerString += org.commonName;
                 } else if (org.id) {
                     organizerString += org.id.replace(/^mailto:/i, "");
                 }
             }
             organizerLabel.setAttribute("value", organizerString);
 
             let attendeeLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "attendee");
-            let attendeeString = attendeeText;
+            let attendeeString = this.mStrings.attendee;
             let att = cal.getInvitedAttendee(aItem);
             if (att) {
                 if (att.commonName && att.commonName.length > 0) {
                     attendeeString += att.commonName;
                 } else if (att.id) {
                     attendeeString += att.id.replace(/^mailto:/i, "");
                 }
             }
--- a/calendar/base/content/dialogs/calendar-summary-dialog.js
+++ b/calendar/base/content/dialogs/calendar-summary-dialog.js
@@ -10,17 +10,16 @@ Components.utils.import("resource://cale
 /**
  * Sets up the summary dialog, setting all needed fields on the dialog from the
  * item received in the window arguments.
  */
 function onLoad() {
     var args = window.arguments[0];
     var item = args.calendarEvent;
     item = item.clone(); // use an own copy of the passed item
-    var calendar = item.calendar;
     window.calendarItem = item;
 
     // the calling entity provides us with an object that is responsible
     // for recording details about the initiated modification. the 'finalize'-property
     // is our hook in order to receive a notification in case the operation needs
     // to be terminated prematurely. this function will be called if the calling
     // entity needs to immediately terminate the pending modification. in this
     // case we serialize the item and close the window.
@@ -48,17 +47,17 @@ function onLoad() {
     if (cal.isEvent(item)) {
         setDialogId(document.documentElement, "calendar-event-summary-dialog");
     } else if (cal.isToDo(item)) {
         setDialogId(document.documentElement, "calendar-task-summary-dialog");
     }
 
     window.attendees = item.getAttendees({});
 
-    calendar = cal.wrapInstance(item.calendar, Components.interfaces.calISchedulingSupport);
+    let calendar = cal.wrapInstance(item.calendar, Components.interfaces.calISchedulingSupport);
     window.readOnly = !(isCalendarWritable(calendar)
                         && (userCanModifyItem(item)
                             || (calendar
                                 && item.calendar.isInvitation(item)
                                 && userCanRespondToInvitation(item))));
     if (!window.readOnly && calendar) {
         var attendee = calendar.getInvitedAttendee(item);
         if (attendee) {
@@ -87,19 +86,19 @@ function onLoad() {
 
     document.getElementById("item-start-row").Item = item;
     document.getElementById("item-end-row").Item = item;
 
     updateInvitationStatus();
 
     // show reminder if this item is *not* readonly.
     // this case happens for example if this is an invitation.
-    var calendar = window.arguments[0].calendarEvent.calendar;
+    let argCalendar = window.arguments[0].calendarEvent.calendar;
     var supportsReminders =
-        (calendar.getProperty("capabilities.alarms.oninvitations.supported") !== false);
+        (argCalendar.getProperty("capabilities.alarms.oninvitations.supported") !== false);
     if (!window.readOnly && supportsReminders) {
         document.getElementById("reminder-row").removeAttribute("hidden");
         loadReminders(window.calendarItem.getAlarms({}));
         updateReminder();
     }
 
     updateRepeatDetails();
     updateAttendees();
--- a/calendar/base/content/preferences/categories.js
+++ b/calendar/base/content/preferences/categories.js
@@ -22,17 +22,17 @@ var gCategoriesPane = {
     init: function gCP_init() {
         // On non-instant-apply platforms, once this pane has been loaded,
         // attach our "revert all changes" function to the parent prefwindow's
         // "ondialogcancel" event.
         var parentPrefWindow = document.documentElement;
         if (!parentPrefWindow.instantApply) {
             var existingOnDialogCancel = parentPrefWindow.getAttribute("ondialogcancel");
             parentPrefWindow.setAttribute("ondialogcancel",
-                                          "gCategoriesPane.panelOnCancel(); " + 
+                                          "gCategoriesPane.panelOnCancel(); " +
                                           existingOnDialogCancel);
         }
 
         // A list of preferences to be reverted when the dialog is cancelled.
         // It needs to be a property of the parent to be visible onCancel
         if (!("backupPrefList" in parent)) {
             parent.backupPrefList = [];
         }
@@ -117,24 +117,24 @@ var gCategoriesPane = {
                             "modal,centerscreen,chrome,resizable=no",
                           "", null, addTitle);
     },
 
     /**
      * Edits the currently selected category using the edit category dialog.
      */
     editCategory: function gCP_editCategory() {
-        var list = document.getElementById("categorieslist");
-        var categoryNameFix = formatStringForCSSRule(gCategoryList[list.selectedIndex]);
+        let list = document.getElementById("categorieslist");
+        let categoryNameFix = formatStringForCSSRule(gCategoryList[list.selectedIndex]);
+        let currentColor = null;
         try {
-            var currentColor = categoryPrefBranch.getCharPref(categoryNameFix);
+            currentColor = categoryPrefBranch.getCharPref(categoryNameFix);
         } catch (ex) {
-            var currentColor = null;
         }
- 
+
         if (list.selectedItem) {
             window.openDialog("chrome://calendar/content/preferences/editCategory.xul",
                               "editCategory",
                               // Workaround for Bug 1151440 - the HTML color picker won't work
                               // in linux when opened from modal dialog
                               (AppConstants.platform == "linux") ?
                                 "centerscreen,chrome,resizable=no" :
                                 "modal,centerscreen,chrome,resizable=no",
@@ -232,17 +232,17 @@ var gCategoriesPane = {
         if (toBeDeleted != -1) {
             list.selectedIndex = toBeDeleted;
             this.deleteCategory();
         }
 
         this.updateCategoryList();
 
         var updatedCategory = gCategoryList.indexOf(categoryName);
-        list.ensureIndexIsVisible(updatedCategory); 
+        list.ensureIndexIsVisible(updatedCategory);
         list.selectedIndex = updatedCategory;
     },
 
     /**
      * Enable the edit and delete category buttons.
      */
     updateButtons: function  gCP_updateButtons() {
         let categoriesList = document.getElementById("categorieslist");
--- a/calendar/base/content/widgets/calendar-subscriptions-list.xml
+++ b/calendar/base/content/widgets/calendar-subscriptions-list.xml
@@ -92,17 +92,17 @@
           }
         ]]></getter>
         <setter><![CDATA[
           var checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (val) {
             checkbox.setAttribute("checked", "true");
           } else {
-            checkbox.removeAttribute("checked");          
+            checkbox.removeAttribute("checked");
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="disabled">
         <getter><![CDATA[
           var checkbox = document.getAnonymousElementByAttribute(
--- a/calendar/base/content/widgets/calendar-widgets.xml
+++ b/calendar/base/content/widgets/calendar-widgets.xml
@@ -385,18 +385,18 @@
             var notifyRefControl = ((aNotifyRefControl == null) || (aNotifyRefControl === true))
             var pushModeCollapsedAttribute = ((aPushModeCollapsedAttribute == null)
                                                  || (aPushModeCollapsedAttribute === true));
             var collapsedModes = [];
             var modeIndex = -1;
             var display = aVisible;
             var collapsedInMode = false;
             if (this.hasAttribute("collapsedinmodes")) {
-                var collapsedModes = this.getAttribute("collapsedinmodes").split(",");
-                var modeIndex = collapsedModes.indexOf(this.currentMode);
+                collapsedModes = this.getAttribute("collapsedinmodes").split(",");
+                modeIndex = collapsedModes.indexOf(this.currentMode);
                 collapsedInMode = (modeIndex > -1);
             }
             if ((aVisible === true) && (pushModeCollapsedAttribute == false)){
                 display = (aVisible === true) && (!collapsedInMode);
             }
 
             setBooleanAttribute(this, "collapsed", (!display || !this.isVisibleInMode()));
             if (pushModeCollapsedAttribute) {
--- a/calendar/base/content/widgets/minimonth.xml
+++ b/calendar/base/content/widgets/minimonth.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0"?>
 
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!--
-/* MiniMonth Calendar: day-of-month grid XBL component.
+   MiniMonth Calendar: day-of-month grid XBL component.
    Displays month name and year above grid of days of month by week rows.
    Arrows move forward or back a month.
    Selecting a month name from month menu moves to that month in same year.
    Selecting a year from year menu moves to same month in selected year.
    Clicking on a day cell calls onchange attribute.
    Changing month via arrows or menus calls onmonthchange attribute.
 
    At site, can provide id, and code to run when value changed by picker.
@@ -21,17 +21,16 @@
 
    Use attributes onpopuplisthidden and onmonthchange for working around
    bugs that occur when minimonth is displayed in a popup (as in datepicker):
      Currently (2005.3)
        whenever a child popup is hidden, the parent popup needs to be reshown.
          Use onpopuplisthidden to reshow parent popop (hidePopup, openPopup).
        When title month or year changes, parent popup may need to be reshown.
          Use onmonthchange to reshow parent popop (hidePopup, openPopup).
-*/
 -->
 <!DOCTYPE bindings
 [
     <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
     <!ENTITY % dtd2 SYSTEM "chrome://global/locale/global.dtd" > %dtd2;
 ]>
 
 <bindings id="xulMiniMonth"
--- a/calendar/base/modules/calIteratorUtils.jsm
+++ b/calendar/base/modules/calIteratorUtils.jsm
@@ -116,18 +116,16 @@ cal.ical = {
         if (aComponent && aComponent.componentType == "VCALENDAR") {
             yield* cal.ical.subcomponentIterator(aComponent, compType);
         } else if (aComponent && aComponent.componentType == "XROOT") {
             for (let calComp of cal.ical.subcomponentIterator(aComponent, "VCALENDAR")) {
                 yield* cal.ical.subcomponentIterator(calComp, compType);
             }
         } else if (aComponent && (compType == "ANY" || compType == aComponent.componentType)) {
             yield aComponent;
-        } else {
-            return null;
         }
     },
 
     /**
      * Use to iterate through all subcomponents of a calIIcalComponent. This
      * iterators depth is 1, this means no sub-sub-components will be iterated.
      *
      * This iterator can only be used in a for() block:
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -1060,17 +1060,17 @@ function sendMessage(aItem, aMethod, aRe
             let sendToList = [aRecipient];
             // remove other recipients from vevent attendee list
             let sendItem = aItem.clone();
             sendItem.removeAllAttendees();
             sendItem.addAttendee(aRecipient);
             // send message
             if (!_sendItem(sendToList, sendItem)) {
                 return false;
-            };
+            }
         }
         return true;
     } else {
         return _sendItem(aRecipientsList, aItem);
     }
 }
 
 /** local to this module file
--- a/calendar/base/modules/calUtils.jsm
+++ b/calendar/base/modules/calUtils.jsm
@@ -459,18 +459,23 @@ var cal = {
         }
         return transp;
     },
 
     // The below functions will move to some different place once the
     // unifinder tress are consolidated.
 
     compareNativeTime: function cal_compareNativeTime(a, b) {
-      return (a < b ? -1 :
-              a > b ?  1 : 0);
+      if (a < b) {
+        return -1;
+      } else if (a > b) {
+        return 1;
+      } else {
+        return 0;
+      }
     },
 
     compareNativeTimeFilledAsc: function cal_compareNativeTimeFilledAsc(a, b) {
       if (a == b)
         return 0;
 
       // In this filter, a zero time (not set) is always at the end.
       if (a == -62168601600000000) // value for (0000/00/00 00:00:00)
@@ -492,18 +497,23 @@ var cal = {
         return -1;
 
       return (a < b ? 1 : -1);
     },
 
     compareNumber: function cal_compareNumber(a, b) {
       a = Number(a);
       b = Number(b);
-      return ((a < b) ? -1 :      // avoid underflow problems of subtraction
-              (a > b) ?  1 : 0);
+      if (a < b) {
+        return -1;
+      } else if (a > b) {
+        return 1;
+      } else {
+        return 0;
+      }
     },
 
     sortEntryComparer: function cal_sortEntryComparer(sortType, modifier) {
       switch (sortType) {
         case "number":
           return function compareNumbers(sortEntryA, sortEntryB) {
             let nsA = cal.sortEntryKey(sortEntryA);
             let nsB = cal.sortEntryKey(sortEntryB);
@@ -827,17 +837,17 @@ var cal = {
                 childNode.remove();
              } else if (!aValue || aValue === undefined) {
                 childNode.remove();
             } else if (childNode && childNode.hasAttribute(aAttribute)
                 && childNode.getAttribute(aAttribute) == aValue) {
                 childNode.remove();
             }
             childNode = prevChildNode;
-        };
+        }
     },
 
     /**
      * Returns the most recent calendar window in an application independent way
      */
     getCalendarWindow: function cal_getCalendarWindow() {
         return Services.wm.getMostRecentWindow("calendarMainWindow") ||
                Services.wm.getMostRecentWindow("mail:3pane");
@@ -860,23 +870,23 @@ var cal = {
                     func(subject, topic, data);
                 }
             }
         };
         Services.obs.addObserver(observer, topic, false /* don't hold weakly */);
     },
 
     /**
-     * Wraps an instance. Replaces calInstanceOf from calUtils.js 
+     * Wraps an instance. Replaces calInstanceOf from calUtils.js
      *
-     * @param aObj the object under consideration 
+     * @param aObj the object under consideration
      * @param aInterface the interface to be wrapped
      *
-     * Use this function to QueryInterface the object to a particular interface. 
-     * You may only expect the return value to be wrapped, not the original passed object. 
+     * Use this function to QueryInterface the object to a particular interface.
+     * You may only expect the return value to be wrapped, not the original passed object.
      * For example:
      * // BAD USAGE:
      * if (cal.wrapInstance(foo, Ci.nsIBar)) {
      *   foo.barMethod();
      * }
      * // GOOD USAGE:
      * foo = cal.wrapInstance(foo, Ci.nsIBar);
      * if (foo) {
--- a/calendar/base/src/calDefaultACLManager.js
+++ b/calendar/base/src/calDefaultACLManager.js
@@ -99,17 +99,17 @@ calDefaultCalendarACLEntry.prototype = {
     },
 
     refresh: function calDefaultCalendarACLEntry_refresh() {
     }
 };
 
 function calDefaultItemACLEntry(aCalendarEntry) {
     this.calendarEntry = aCalendarEntry;
-};
+}
 
 calDefaultItemACLEntry.prototype = {
     /* nsISupports */
     QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIItemACLEntry]),
 
     /* calIItemACLEntry */
     calendarEntry: null,
     userCanModify: true,
--- a/calendar/base/src/calItemBase.js
+++ b/calendar/base/src/calItemBase.js
@@ -349,27 +349,27 @@ calItemBase.prototype = {
                 mCurrentProp: null,
 
                 hasMoreElements: function cib_pe_hasMoreElements() {
                     if (this.mCurrentProp) {
                         return true;
                     }
                     if (this.mProxyEnum) {
                         while (this.mProxyEnum.hasMoreElements()) {
-                            var prop = this.mProxyEnum.getNext();
+                            let prop = this.mProxyEnum.getNext();
                             this.mHandledProps[prop.name] = true;
                             if (prop.value !== null) {
                                 this.mCurrentProp = prop;
                                 return true;
                             } // else skip the deleted properties
                         }
                         this.mProxyEnum = null;
                     }
                     while (this.mParentEnum.hasMoreElements()) {
-                        var prop = this.mParentEnum.getNext();
+                        let prop = this.mParentEnum.getNext();
                         if (!this.mHandledProps[prop.name]) {
                             this.mCurrentProp = prop;
                             return true;
                         }
                     }
                     return false;
                 },
 
--- a/calendar/base/src/calRecurrenceInfo.js
+++ b/calendar/base/src/calRecurrenceInfo.js
@@ -487,58 +487,58 @@ calRecurrenceInfo.prototype = {
         if (rangeStart && rangeEnd) {
             maxCount = 0;
         } else {
             maxCount = aMaxCount;
         }
 
         // Apply positive rules
         for (let ritem of this.mPositiveRules) {
-            var cur_dates = ritem.getOccurrences(startDate,
+            let cur_dates = ritem.getOccurrences(startDate,
                                                  searchStart,
                                                  rangeEnd,
                                                  maxCount, {});
             if (cur_dates.length == 0) {
                 continue;
             }
 
             // if positive, we just add these date to the existing set,
             // but only if they're not already there
 
-            var index = 0;
-            var len = cur_dates.length;
+            let index = 0;
+            let len = cur_dates.length;
 
             // skip items before rangeStart due to searchStart libical hack:
             if (rangeStart && baseDuration) {
                 for (; index < len; ++index) {
-                    var date = cur_dates[index].clone();
+                    let date = cur_dates[index].clone();
                     date.addDuration(baseDuration);
                     if (rangeStart.compare(date) < 0) {
                         break;
                     }
                 }
             }
             for (; index < len; ++index) {
-                var date = cur_dates[index];
-                var dateKey = getRidKey(date);
+                let date = cur_dates[index];
+                let dateKey = getRidKey(date);
                 if (occurrenceMap[dateKey]) {
                     // Don't add occurrences twice (i.e exception was
                     // already added before)
                     continue;
                 }
                 // TODO if cur_dates[] is also sorted, then this binary
                 // search could be optimized further
                 binaryInsert(dates, { id: date, rstart: date }, ridDateSortComptor);
                 occurrenceMap[dateKey] = true;
             }
         }
 
         // Apply negative rules
         for (let ritem of this.mNegativeRules) {
-            var cur_dates = ritem.getOccurrences(startDate,
+            let cur_dates = ritem.getOccurrences(startDate,
                                                  searchStart,
                                                  rangeEnd,
                                                  maxCount, {});
             if (cur_dates.length == 0) {
                 continue;
             }
 
             // XXX: i'm pretty sure negative dates can't really have exceptions
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -362,17 +362,17 @@ function guessSystemTimezone() {
                 return 3;
             } else {
                 return 2;
             }
         }
 
         if (offsetDec == standardTZOffset && offsetJun == daylightTZOffset &&
             daylight) {
-            var dateMatchWt = systemTZMatchesTimeShiftDates(tz, subComp);
+            let dateMatchWt = systemTZMatchesTimeShiftDates(tz, subComp);
             if (dateMatchWt > 0) {
                 if (standardName && standardName == tzNameJun &&
                     daylightName && daylightName == tzNameDec) {
                     return 3;
                 } else {
                     return dateMatchWt;
                 }
             }
@@ -385,17 +385,17 @@ function guessSystemTimezone() {
                 return 3;
             } else {
                 return 2;
             }
         }
 
         if (offsetJun == standardTZOffset && offsetDec == daylightTZOffset &&
             daylight) {
-            var dateMatchWt = systemTZMatchesTimeShiftDates(tz, subComp);
+            let dateMatchWt = systemTZMatchesTimeShiftDates(tz, subComp);
             if (dateMatchWt > 0) {
                 if (standardName && standardName == tzNameJun &&
                     daylightName && daylightName == tzNameDec) {
                     return 3;
                 } else {
                     return dateMatchWt;
                 }
             }
@@ -657,18 +657,18 @@ function guessSystemTimezone() {
             let results = osUserTimeZone.match(tzRegex);
             if (results) {
                 zoneInfoIdFromOSUserTimeZone = results[1];
             }
         }
 
         // check how well OS tz matches tz defined in our version of zoneinfo db
         if (zoneInfoIdFromOSUserTimeZone != null) {
-            var tzId = zoneInfoIdFromOSUserTimeZone;
-            var score = checkTZ(tzId);
+            let tzId = zoneInfoIdFromOSUserTimeZone;
+            let score = checkTZ(tzId);
             switch(score) {
             case 0:
                 // Did not match.
                 // Maybe OS or Application is old, and the timezone changed.
                 // Or maybe user turned off DST in Date/Time control panel.
                 // Will look for a better matching tz, or fallback to floating.
                 // (Match OS so alarms go off at time indicated by OS clock.)
                 cal.WARN(calProperties.formatStringFromName(
@@ -676,102 +676,99 @@ function guessSystemTimezone() {
                 break;
             case 1: case 2:
                 // inexact match: OS TZ and our ZoneInfo TZ matched imperfectly.
                 // Will keep looking, will use tzId unless another is better.
                 // (maybe OS TZ has changed to match a nearby TZ, so maybe
                 // another ZoneInfo TZ matches it better).
                 probableTZId = tzId;
                 probableTZScore = score;
-                probableTZSource = (calProperties.formatStringFromName
-                                    ("TZFromOS", [osUserTimeZone], 1));
+                probableTZSource = calProperties.formatStringFromName(
+                    "TZFromOS", [osUserTimeZone], 1);
+
                 break;
             case 3:
                 // exact match
                 return tzId;
             }
         }
     } catch (ex) {
         // zoneInfo id given was not recognized by our ZoneInfo database
-        var errMsg = (calProperties.formatStringFromName
-                      ("SkippingOSTimezone",
-                       [zoneInfoIdFromOSUserTimeZone || osUserTimeZone], 1));
-        Components.utils.reportError(errMsg+" "+ex);
+        let errParams = [zoneInfoIdFromOSUserTimeZone || osUserTimeZone];
+        let errMsg = calProperties.formatStringFromName("SkippingOSTimezone", errParams, 1);
+        Components.utils.reportError(errMsg + " " + ex);
     }
 
     // Second, give priority to "likelyTimezone"s if provided by locale.
     try {
         // The likelyTimezone property is a comma-separated list of
         // ZoneInfo timezone ids.
         const bundleTZString =
             calProperties.GetStringFromName("likelyTimezone");
         const bundleTZIds = bundleTZString.split(/\s*,\s*/);
-        for (var bareTZId of bundleTZIds) {
-            var tzId = bareTZId;
+        for (let bareTZId of bundleTZIds) {
+            let tzId = bareTZId;
             try {
-                var score = checkTZ(tzId);
+                let score = checkTZ(tzId);
 
                 switch (score) {
                 case 0:
                     break;
                 case 1: case 2:
                     if (score > probableTZScore) {
                         probableTZId = tzId;
                         probableTZScore = score;
-                        probableTZSource = (calProperties.GetStringFromName
-                                            ("TZFromLocale"));
+                        probableTZSource = calProperties.GetStringFromName("TZFromLocale");
                     }
                     break;
                 case 3:
                     return tzId;
                 }
             } catch (ex) {
-                var errMsg = (calProperties.formatStringFromName
-                              ("SkippingLocaleTimezone", [bareTZId], 1));
+                let errMsg = calProperties.formatStringFromName(
+                    "SkippingLocaleTimezone", [bareTZId], 1);
                 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;
     while (tzIDs.hasMore()) {
-        var tzId = tzIDs.getNext();
+        let tzId = tzIDs.getNext();
         try {
-            var score = checkTZ(tzId);
+            let score = checkTZ(tzId);
             switch(score) {
             case 0: break;
             case 1: case 2:
                 if (score > probableTZScore) {
                     probableTZId = tzId;
                     probableTZScore = score;
-                    probableTZSource = (calProperties.GetStringFromName
-                                        ("TZFromKnownTimezones"));
+                    probableTZSource = calProperties.GetStringFromName("TZFromKnownTimezones");
                 }
                 break;
             case 3:
                 return tzId;
             }
         } catch (ex) { // bug if ics service doesn't recognize own tzid!
-            var msg = ("ics-service doesn't recognize own tzid: "+tzId+"\n"+
-                       ex);
+            let msg = "ics-service doesn't recognize own tzid: " + tzId + "\n" + ex;
             Components.utils.reportError(msg);
         }
     }
 
     // If reach here, there were no score=3 matches, so Warn in console.
     try {
         switch(probableTZScore) {
         case 0:
             cal.WARN(calProperties.GetStringFromName("warningUsingFloatingTZNoMatch"));
             break;
         case 1: case 2:
-            var tzId = probableTZId;
+            let tzId = probableTZId;
             var tz = tzSvc.getTimezone(tzId);
             var subComp = tz.icalComponent;
             var standard = findCurrentTimePeriod(tz, subComp, "STANDARD");
             var standardTZOffset = getIcalString(standard, "TZOFFSETTO");
             var daylight = findCurrentTimePeriod(tz, subComp, "DAYLIGHT");
             var daylightTZOffset = getIcalString(daylight, "TZOFFSETTO");
             var warningDetail;
             if (probableTZScore == 1) {
@@ -788,28 +785,25 @@ function guessSystemTimezone() {
                 var daylightRule  = getIcalString(daylight, "RRULE");
                 var daylightText =
                     ("  Daylight: "+daylightStart+" "+daylightStartWeekday+"\n"+
                      "            "+daylightRule+"\n");
                 warningDetail =
                     ((standardStart < daylightStart
                       ? standardText + daylightText
                       : daylightText + standardText)+
-                     (calProperties.GetStringFromName
-                      ("TZAlmostMatchesOSDifferAtMostAWeek")));
+                     (calProperties.GetStringFromName(
+                      "TZAlmostMatchesOSDifferAtMostAWeek")));
             } else {
-                warningDetail =
-                    (calProperties.GetStringFromName("TZSeemsToMatchOS"));
+                warningDetail = calProperties.GetStringFromName("TZSeemsToMatchOS");
             }
-            var offsetString = (standardTZOffset+
-                                 (!daylightTZOffset? "": "/"+daylightTZOffset));
-            var warningMsg = (calProperties.formatStringFromName
-                              ("WarningUsingGuessedTZ",
-                               [tzId, offsetString, warningDetail,
-                                probableTZSource], 4));
+            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);
     }
 
     // return the guessed timezone
--- a/calendar/base/src/calUtils.js
+++ b/calendar/base/src/calUtils.js
@@ -915,26 +915,24 @@ function LOG(aArg) {
     try {
         shouldLog = Services.prefs.getBoolPref("calendar.debug.log");
     } catch(ex) {}
 
     if (!shouldLog) {
         return;
     }
     ASSERT(aArg, "Bad log argument.", false);
-    var string;
+    var string = aArg;
     // We should just dump() both String objects, and string primitives.
     if (!(aArg instanceof String) && !(typeof(aArg) == "string")) {
-        var string = "Logging object...\n";
+        string = "Logging object...\n";
         for (var prop in aArg) {
             string += prop + ': ' + aArg[prop] + '\n';
         }
         string += "End object\n";
-    } else {
-        string = aArg;
     }
 
     dump(string + '\n');
     _log(string, Components.interfaces.nsIScriptError.infoFlag);
 }
 
 /**
  * Dumps a warning to both console and js console.
@@ -1449,17 +1447,17 @@ function isPropertyValueSame(aObjects, a
  */
 function getParentNodeOrThis(aChildNode, aLocalName) {
     var node = aChildNode;
     while (node && (node.localName != aLocalName)) {
         node = node.parentNode;
         if (node.tagName == undefined) {
             return null;
         }
-    };
+    }
     return node;
 }
 
 /**
  * Returns a parentnode  - or the overgiven node -  with the given attributevalue
  * for the given attributename by "walking up" the DOM-hierarchy.
  *
  * @param aChildNode      The childnode.
@@ -1472,17 +1470,17 @@ function getParentNodeOrThis(aChildNode,
  */
 function getParentNodeOrThisByAttribute(aChildNode, aAttributeName, aAttributeValue) {
     var node = aChildNode;
     while (node && (node.getAttribute(aAttributeName) != aAttributeValue)) {
         node = node.parentNode;
         if (node.tagName == undefined) {
             return null;
         }
-    };
+    }
     return node;
 }
 
 function setItemProperty(item, propertyName, aValue, aCapability) {
     var isSupported = (item.calendar.getProperty("capabilities." + aCapability + ".supported") !== false)
     var value = (aCapability && !isSupported ? null : aValue);
 
     switch (propertyName) {
--- a/calendar/base/src/calWeekInfoService.js
+++ b/calendar/base/src/calWeekInfoService.js
@@ -20,21 +20,21 @@ calWeekInfoService.prototype = {
         classDescription: "Calendar WeekInfo Service",
         interfaces: calWeekInfoServiceInterfaces,
         flags: Components.interfaces.nsIClassInfo.SINGLETON
     }),
 
     // calIWeekInfoService:
     getWeekTitle: function(aDateTime) {
         /**
-         * This implementation is based on the ISO 8601 standard.  
+         * This implementation is based on the ISO 8601 standard.
          * ISO 8601 defines week one as the first week with at least 4
          * days, and defines Monday as the first day of the week.
          * Equivalently, the week one is the week with the first Thursday.
-         * 
+         *
          * This implementation uses the second definition, because it
          * enables the user to set a different start-day of the week
          * (Sunday instead of Monday is a common setting).  If the first
          * definition was used, all week-numbers could be off by one
          * depending on the week start day.  (For example, if weeks start
          * on Sunday, a year that starts on Thursday has only 3 days
          * [Thu-Sat] in that week, so it would be part of the last week of
          * the previous year, but if weeks start on Monday, the year would
@@ -56,17 +56,17 @@ calWeekInfoService.prototype = {
         // which may be part of the week counted in the previous year.) So we
         // need the startWeekday.
         const SUNDAY = 0;
         var startWeekday = Preferences.get("calendar.week.start", SUNDAY); // default to monday per ISO8601 standard.
 
         // The number of days since the start of the week.
         // Notice that the result of the substraction might be negative.
         // We correct for that by adding 7, and then using the remainder operator.
-        var sinceStartOfWeek = (aDateTime.weekday - startWeekday + 7) % 7; 
+        var sinceStartOfWeek = (aDateTime.weekday - startWeekday + 7) % 7;
 
         // The number of days to Thursday is the difference between Thursday
         // and the start-day of the week (again corrected for negative values).
         const THURSDAY = 4;
         var startToThursday = (THURSDAY - startWeekday + 7) % 7;
 
         // The yearday number of the Thursday this week.
         var thisWeeksThursday = aDateTime.yearday - sinceStartOfWeek + startToThursday;
@@ -81,17 +81,17 @@ calWeekInfoService.prototype = {
             thisWeeksThursday -= aDateTime.endOfYear.yearday;
         }
 
         var weekNumber = Math.ceil(thisWeeksThursday/7);
         return weekNumber;
     },
 
     /**
-     * gets the first day of a week of a passed day under consideration 
+     * 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
      * @return          a dateTime-object denoting the first day of the week
      */
     getStartOfWeek: function(aDate) {
         var date = aDate.clone();
         date.isDate = true;
@@ -100,17 +100,17 @@ calWeekInfoService.prototype = {
             date.day -= (7 - offset);
         } else {
             date.day += offset;
         }
         return date;
     },
 
     /**
-     * gets the last day of a week of a passed day under consideration 
+     * gets the last day of a week of a passed day under consideration
      * of the preference setting "calendar.week.start"
      *
      * @param aDate     a date time object
      * @return          a dateTime-object denoting the last day of the week
      */
     getEndOfWeek: function(aDate) {
         var date = this.getStartOfWeek(aDate);
         date.day += 6;
--- a/calendar/import-export/calOutlookCSVImportExport.js
+++ b/calendar/import-export/calOutlookCSVImportExport.js
@@ -125,257 +125,254 @@ calOutlookCSVImporter.prototype = {
      *   If the parse is cancelled, a zero length array is returned.
      */
     importFromStream: function csv_importFromStream(aStream, aCount) {
         let scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"]
                                               .createInstance(Components.interfaces.nsIScriptableInputStream);
         scriptableInputStream.init(aStream);
         let str = scriptableInputStream.read(-1);
 
-        parse: {
-            // parse header line of quoted comma separated column names.
-            let trimEndQuotesRegExp = /^"(.*)"$/m;
-            let trimResults = trimEndQuotesRegExp.exec( str );
-            let header = trimResults && trimResults[1].split(/","/);
-            if (header == null) {
-                break parse;
-            }
+        // parse header line of quoted comma separated column names.
+        let trimEndQuotesRegExp = /^"(.*)"$/m;
+        let trimResults = trimEndQuotesRegExp.exec( str );
+        let header = trimResults && trimResults[1].split(/","/);
+        if (header == null) {
+            aCount.value = 0;
+            return [];
+        }
 
-            //strip header from string
-            str = str.slice(trimResults[0].length);
+        //strip header from string
+        str = str.slice(trimResults[0].length);
 
-            let args = {};
-            //args.fieldList contains the field names from the first row of CSV
-            args.fieldList = header;
+        let args = {};
+        //args.fieldList contains the field names from the first row of CSV
+        args.fieldList = header;
 
-            let locale;
-            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] ) {
-                        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;
-                        case locale.headAlarmTime:    args.alarmTimeIndex = i;   knownIndxs++; break;
-                        case locale.headCategories:   args.categoriesIndex = i;  knownIndxs++; break;
-                        case locale.headDescription:  args.descriptionIndex = i; knownIndxs++; break;
-                        case locale.headLocation:     args.locationIndex = i;    knownIndxs++; break;
-                        case locale.headPrivate:      args.privateIndex = i;     knownIndxs++; break;
-                    }
-                }
-                // Were both mandatory fields recognized?
-                if (args.titleIndex != 0 && args.startDateIndex != 0) {
-                    break;
+        let locale;
+        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] ) {
+                    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;
+                    case locale.headAlarmTime:    args.alarmTimeIndex = i;   knownIndxs++; break;
+                    case locale.headCategories:   args.categoriesIndex = i;  knownIndxs++; break;
+                    case locale.headDescription:  args.descriptionIndex = i; knownIndxs++; break;
+                    case locale.headLocation:     args.locationIndex = i;    knownIndxs++; break;
+                    case locale.headPrivate:      args.privateIndex = i;     knownIndxs++; break;
                 }
             }
+            // Were both mandatory fields recognized?
+            if (args.titleIndex != 0 && args.startDateIndex != 0) {
+                break;
+            }
+        }
 
-            if (knownIndxs == 0 && header.length == 22) {
-                // set default indexes for a default Outlook2000 CSV file
-                args.titleIndex = 1;
-                args.startDateIndex = 2;
-                args.startTimeIndex = 3;
-                args.endDateIndex = 4;
-                args.endTimeIndex = 5;
-                args.allDayIndex = 6;
-                args.alarmIndex = 7;
-                args.alarmDateIndex = 8;
-                args.alarmTimeIndex = 9;
-                args.categoriesIndex = 15;
-                args.descriptionIndex = 16;
-                args.locationIndex = 17;
-                args.privateIndex = 20;
-            }
+        if (knownIndxs == 0 && header.length == 22) {
+            // set default indexes for a default Outlook2000 CSV file
+            args.titleIndex = 1;
+            args.startDateIndex = 2;
+            args.startTimeIndex = 3;
+            args.endDateIndex = 4;
+            args.endTimeIndex = 5;
+            args.allDayIndex = 6;
+            args.alarmIndex = 7;
+            args.alarmDateIndex = 8;
+            args.alarmTimeIndex = 9;
+            args.categoriesIndex = 15;
+            args.descriptionIndex = 16;
+            args.locationIndex = 17;
+            args.privateIndex = 20;
+        }
+
+        if (args.titleIndex == 0 || args.startDateIndex == 0) {
+            dump("Can't import. Life sucks\n")
+            aCount.value = 0;
+            return [];
+        }
+
+        // Construct event regexp according to field indexes. The regexp can
+        // be made stricter, if it seems this matches too loosely.
+        let regExpStr = "^";
+        for (i = 1; i <= header.length; i++) {
+            if (i > 1)
+                regExpStr += ",";
+            regExpStr += "(?:\"((?:[^\"]|\"\")*)\")?";
+        }
+        regExpStr += "$";
 
-            if (args.titleIndex == 0 || args.startDateIndex == 0) {
-                dump("Can't import. Life sucks\n")
-                break parse;
-            }
+        // eventRegExp: regexp for reading events (this one'll be constructed on fly)
+        const eventRegExp = new RegExp(regExpStr, "gm");
+
+        // match first line
+        let eventFields = eventRegExp.exec(str);
+
+        if (eventFields == null) {
+            aCount.value = 0;
+            return [];
+        }
+
+        args.boolStr = localeEn.valueTrue;
+        args.boolIsTrue = true;
 
-            // Construct event regexp according to field indexes. The regexp can
-            // be made stricter, if it seems this matches too loosely.
-            let regExpStr = "^";
-            for (i = 1; i <= header.length; i++) {
-                if (i > 1)
-                    regExpStr += ",";
-                regExpStr += "(?:\"((?:[^\"]|\"\")*)\")?";
-            }
-            regExpStr += "$";
+        let dateParseConfirmed = false;
+        let eventArray = new Array();
+        do {
+            // At this point eventFields contains following fields. Position
+            // of fields is in args.[fieldname]Index.
+            //    subject, start date, start time, end date, end time,
+            //    all day, alarm on, alarm date, alarm time,
+            //    Description, Categories, Location, Private
+            // Unused fields (could maybe be copied to Description):
+            //    Meeting Organizer, Required Attendees, Optional Attendees,
+            //    Meeting Resources, Billing Information, Mileage, Priority,
+            //    Sensitivity, Show time as
 
-            // eventRegExp: regexp for reading events (this one'll be constructed on fly)
-            const eventRegExp = new RegExp(regExpStr, "gm");
-
-            // match first line
-            let eventFields = eventRegExp.exec(str);
-
-            if (eventFields == null)
-                break parse;
+            let title = ("titleIndex" in args
+                         ? this.parseTextField(eventFields[args.titleIndex]) : "");
+            let sDate = this.parseDateTime(eventFields[args.startDateIndex],
+                                           eventFields[args.startTimeIndex],
+                                           locale);
+            let eDate = this.parseDateTime(eventFields[args.endDateIndex],
+                                           eventFields[args.endTimeIndex],
+                                           locale);
+            // Create an event only if we have a startDate. No more checks
+            // on sDate needed in the following process.
+            if (sDate) {
+                let event = cal.createEvent();
 
-            args.boolStr = localeEn.valueTrue;
-            args.boolIsTrue = true;
+                // Use column head in brackets if event title misses in data.
+                if (title) {
+                    event.title = title;
+                } else {
+                    event.title = "[" + locale.headTitle + "]";
+                }
 
-            let dateParseConfirmed = false;
-            let eventArray = new Array();
-            do {
-                // At this point eventFields contains following fields. Position
-                // of fields is in args.[fieldname]Index.
-                //    subject, start date, start time, end date, end time,
-                //    all day, alarm on, alarm date, alarm time,
-                //    Description, Categories, Location, Private
-                // Unused fields (could maybe be copied to Description):
-                //    Meeting Organizer, Required Attendees, Optional Attendees,
-                //    Meeting Resources, Billing Information, Mileage, Priority,
-                //    Sensitivity, Show time as
+                // Check data for all day event. Additionally sDate.isDate
+                // may have been set in parseDateTime() if no time was found
+                if (eventFields[args.allDayIndex] == locale.valueTrue) {
+                    sDate.isDate = true;
+                }
+                if (locale.valueTrue == eventFields[args.privateIndex]) {
+                    event.privacy = "PRIVATE";
+                }
 
-                let title = ("titleIndex" in args
-                             ? this.parseTextField(eventFields[args.titleIndex]) : "");
-                let sDate = this.parseDateTime(eventFields[args.startDateIndex],
-                                               eventFields[args.startTimeIndex],
-                                               locale);
-                let eDate = this.parseDateTime(eventFields[args.endDateIndex],
-                                               eventFields[args.endTimeIndex],
-                                               locale);
-                // Create an event only if we have a startDate. No more checks
-                // on sDate needed in the following process.
-                if (sDate) {
-                    let event = cal.createEvent();
+                if (!eDate) {
+                    // No endDate was found. All day events last one day and
+                    // timed events last the default length.
+                    eDate = sDate.clone();
+                    if (sDate.isDate) {
+                        // end date is exclusive, so set to next day after start.
+                        eDate.day += 1;
+                    } else {
+                        eDate.minute += Preferences.get("calendar.event.defaultlength", 60);
+                    }
+                } else {
+                    // An endDate was found.
+                    if (sDate.isDate) {
+                        // A time part for the startDate is missing or was
+                        // not recognized. We have to throw away the endDates
+                        // time part too for obtaining a valid event.
+                        eDate.isDate = true;
+                        // Correct the eDate if duration is less than one day.
+                        if (1 > eDate.subtractDate(sDate).days) {
+                            eDate = sDate.clone();
+                            eDate.day += 1;
+                        }
+                    } else {
+                        // We now have a timed startDate and an endDate. If the
+                        // end time is invalid set it to 23:59:00
+                        if (eDate.isDate) {
+                            eDate.isDate = false;
+                            eDate.hour   = 23;
+                            eDate.minute = 59;
+                        }
+                        // Correct the duration to 0 seconds if it is negative.
+                        if (eDate.subtractDate(sDate).isNegative ) {
+                            eDate = sDate.clone();
+                        }
+                    }
+                }
+                event.startDate = sDate;
+                event.endDate = eDate;
 
-                    // Use column head in brackets if event title misses in data.
-                    if (title) {
-                        event.title = title;
-                    } else {
-                        event.title = "[" + locale.headTitle + "]";
+                // Exists an alarm true/false column?
+                if ("alarmIndex" in args) {
+                    // Is an alarm wanted for this event?
+                    if (locale.valueTrue == eventFields[args.alarmIndex]) {
+                        let alarmDate =
+                                this.parseDateTime(eventFields[args.alarmDateIndex],
+                                                   eventFields[args.alarmTimeIndex],
+                                                   locale);
+                        // Only set the alarm if a date was parsed
+                        if (alarmDate) {
+                            let alarm = cal.createAlarm();
+                            alarm.related = alarm.ALARM_RELATED_ABSOLUTE;
+                            alarm.alarmDate = alarmDate;
+                            event.addAlarm(alarm);
+                        } else {
+                            // XXX Is this really wanted here?
+                            cal.alarms.setDefaultValues(event);
+                        }
                     }
+                }
 
-                    // Check data for all day event. Additionally sDate.isDate
-                    // may have been set in parseDateTime() if no time was found
-                    if (eventFields[args.allDayIndex] == locale.valueTrue) {
-                        sDate.isDate = true;
-                    }
+                // Using the "Private" field only for getting privacy status.
+                // "Sensitivity" is neglected for now.
+                if ("privateIndex" in args) {
                     if (locale.valueTrue == eventFields[args.privateIndex]) {
                         event.privacy = "PRIVATE";
                     }
-
-                    if (!eDate) {
-                        // No endDate was found. All day events last one day and
-                        // timed events last the default length.
-                        eDate = sDate.clone();
-                        if (sDate.isDate) {
-                            // end date is exclusive, so set to next day after start.
-                            eDate.day += 1;
-                        } else {
-                            eDate.minute += Preferences.get("calendar.event.defaultlength", 60);
-                        }
-                    } else {
-                        // An endDate was found.
-                        if (sDate.isDate) {
-                            // A time part for the startDate is missing or was
-                            // not recognized. We have to throw away the endDates
-                            // time part too for obtaining a valid event.
-                            eDate.isDate = true;
-                            // Correct the eDate if duration is less than one day.
-                            if (1 > eDate.subtractDate(sDate).days) {
-                                eDate = sDate.clone();
-                                eDate.day += 1;
-                            }
-                        } else {
-                            // We now have a timed startDate and an endDate. If the
-                            // end time is invalid set it to 23:59:00
-                            if (eDate.isDate) {
-                                eDate.isDate = false;
-                                eDate.hour   = 23;
-                                eDate.minute = 59;
-                            }
-                            // Correct the duration to 0 seconds if it is negative.
-                            if (eDate.subtractDate(sDate).isNegative ) {
-                                eDate = sDate.clone();
-                            }
-                        }
-                    }
-                    event.startDate = sDate;
-                    event.endDate = eDate;
-
-                    // Exists an alarm true/false column?
-                    if ("alarmIndex" in args) {
-                        // Is an alarm wanted for this event?
-                        if (locale.valueTrue == eventFields[args.alarmIndex]) {
-                            let alarmDate =
-                                    this.parseDateTime(eventFields[args.alarmDateIndex],
-                                                       eventFields[args.alarmTimeIndex],
-                                                       locale);
-                            // Only set the alarm if a date was parsed
-                            if (alarmDate) {
-                                let alarm = cal.createAlarm();
-                                alarm.related = alarm.ALARM_RELATED_ABSOLUTE;
-                                alarm.alarmDate = alarmDate;
-                                event.addAlarm(alarm);
-                            } else {
-                                // XXX Is this really wanted here?
-                                cal.alarms.setDefaultValues(event);
-                            }
-                        }
-                    }
-
-                    // Using the "Private" field only for getting privacy status.
-                    // "Sensitivity" is neglected for now.
-                    if ("privateIndex" in args) {
-                        if (locale.valueTrue == eventFields[args.privateIndex]) {
-                            event.privacy = "PRIVATE";
-                        }
-                    }
-
-                    // Avoid setting empty properties
-                    let txt = "";
-                    if ("descriptionIndex" in args) {
-                        txt = this.parseTextField(eventFields[args.descriptionIndex])
-                        if (txt) {
-                            event.setProperty("DESCRIPTION", txt);
-                        }
-                    }
-                    if ("categoriesIndex" in args) {
-                        txt = this.parseTextField(eventFields[args.categoriesIndex])
-                        if (txt) {
-                            let categories = cal.categoriesStringToArray(txt);
-                            event.setCategories(categories.length, categories);
-                        }
-                    }
-                    if ("locationIndex" in args) {
-                        txt = this.parseTextField(eventFields[args.locationIndex])
-                        if (txt) {
-                            event.setProperty("LOCATION", txt);
-                        }
-                    }
-
-                    //save the event into return array
-                    eventArray.push(event);
                 }
 
-                //get next events fields
-                eventFields = eventRegExp.exec(str);
-
-            } while (eventRegExp.lastIndex != 0);
+                // Avoid setting empty properties
+                let txt = "";
+                if ("descriptionIndex" in args) {
+                    txt = this.parseTextField(eventFields[args.descriptionIndex])
+                    if (txt) {
+                        event.setProperty("DESCRIPTION", txt);
+                    }
+                }
+                if ("categoriesIndex" in args) {
+                    txt = this.parseTextField(eventFields[args.categoriesIndex])
+                    if (txt) {
+                        let categories = cal.categoriesStringToArray(txt);
+                        event.setCategories(categories.length, categories);
+                    }
+                }
+                if ("locationIndex" in args) {
+                    txt = this.parseTextField(eventFields[args.locationIndex])
+                    if (txt) {
+                        event.setProperty("LOCATION", txt);
+                    }
+                }
 
-            // return results
-            aCount.value = eventArray.length;
-            return eventArray;
+                //save the event into return array
+                eventArray.push(event);
+            }
 
-        } // end parse
+            //get next events fields
+            eventFields = eventRegExp.exec(str);
 
-        // The parse was cancelled, return an empty array of events.
-        aCount.value = 0;
-        return [];
+        } while (eventRegExp.lastIndex != 0);
+
+        // return results
+        aCount.value = eventArray.length;
+        return eventArray;
     },
 
     parseDateTime: function parseDateTime(aDate, aTime, aLocale) {
         let dt = cal.createDateTime();
 
         //XXX Can we do better?
         dt.timezone = cal.floating();
 
--- a/calendar/lightning/components/calItipProtocolHandler.js
+++ b/calendar/lightning/components/calItipProtocolHandler.js
@@ -4,16 +4,17 @@
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
 
 var CI = Components.interfaces;
 
 var ITIP_HANDLER_MIMETYPE = "application/x-itip-internal";
 var ITIP_HANDLER_PROTOCOL = "moz-cal-handle-itip";
+var NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
 
 
 function NYI() {
     throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
 }
 
 function ItipChannel(URI) {
    this.URI = this.originalURI = URI;
@@ -35,25 +36,25 @@ ItipChannel.prototype = {
 
     contentType: ITIP_HANDLER_MIMETYPE,
     loadAttributes: null,
     contentLength: 0,
     owner: null,
     loadGroup: null,
     notificationCallbacks: null,
     securityInfo: null,
-    
+
     open: NYI,
     asyncOpen: function (observer, ctxt) {
         observer.onStartRequest(this, ctxt);
     },
     asyncRead: function (listener, ctxt) {
         return listener.onStartRequest(this, ctxt);
     },
-    
+
     isPending: function () { return true; },
     status: Components.results.NS_OK,
     cancel: function (status) { this.status = status; },
     suspend: NYI,
     resume: NYI,
 };
 
 function ItipProtocolHandler() {
@@ -76,17 +77,17 @@ ItipProtocolHandler.prototype = {
     isSecure: false,
     newURI: function (spec, charSet, baseURI) {
         let cls = Components.classes["@mozilla.org/network/standard-url;1"];
         let url = cls.createInstance(CI.nsIStandardURL);
         url.init(CI.nsIStandardURL.URLTYPE_STANDARD, 0, spec, charSet, baseURI);
         dump("Creating new URI for " + spec + "\n");
         return url.QueryInterface(CI.nsIURI);
     },
-    
+
     newChannel: function (URI) {
         return this.newChannel2(URI, null);
     },
 
     newChannel2: function(URI, aLoadInfo)
     {
         dump("Creating new ItipChannel for " + URI + "\n");
         return new ItipChannel(URI);
@@ -108,17 +109,17 @@ ItipContentHandler.prototype = {
         interfaces: ItipContentHandlerInterfaces
     }),
 
     handleContent: function (contentType, windowTarget, request) {
         let channel = request.QueryInterface(CI.nsIChannel);
         let uri = channel.URI.spec;
         if (!uri.startsWith(ITIP_HANDLER_PROTOCOL + ":")) {
             cal.ERROR("Unexpected iTIP uri: " + uri + "\n");
-            return Components.results.NS_ERROR_FAILURE;
+            throw NS_ERROR_WONT_HANDLE_CONTENT;
         }
         // moz-cal-handle-itip:///?
         let paramString = uri.substring(ITIP_HANDLER_PROTOCOL.length + 4);
         let paramArray = paramString.split("&");
         let paramBlock = { };
         paramArray.forEach(function (v) {
             let parts = v.split("=");
             paramBlock[parts[0]] = unescape(unescape(parts[1]));
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -1078,17 +1078,17 @@ calDavCalendar.prototype = {
         // that pass paths like /dav/user/Calendar while
         // the request uri is like /dav/user@example.org/Calendar.
         let resPathComponents = path.split("/");
         resPathComponents.splice(0, uriPathComponentLength - 1);
         let locationPath = resPathComponents.join("/");
         let isInboxItem = this.isInbox(aUri.spec);
         let self = this;
 
-        Task.spawn(function*() {
+        Task.spawn(function* () {
             if (self.mHrefIndex[path] &&
                 !self.mItemInfoCache[item.id]) {
                 // If we get here it means a meeting has kept the same filename
                 // but changed its uid, which can happen server side.
                 // Delete the meeting before re-adding it
                 self.deleteTargetCalendarItem(path);
             }
 
@@ -1146,17 +1146,17 @@ calDavCalendar.prototype = {
         });
     },
 
     /**
      * Deletes an item from the target calendar
      *
      * @param path Path of the item to delete, must not be encoded
      */
-    deleteTargetCalendarItem: Task.async(function*(path) {
+    deleteTargetCalendarItem: Task.async(function* (path) {
         let pcal = cal.async.promisifyCalendar(this.mOfflineStorage);
 
         let foundItem = (yield pcal.getItem(this.mHrefIndex[path]))[0];
         let wasInboxItem = this.mItemInfoCache[foundItem.id].isInboxItem;
         if ((wasInboxItem && this.isInbox(path)) ||
             (wasInboxItem === false && !this.isInbox(path))) {
 
             cal.LOG("CalDAV: deleting item: " + path + ", uid: " + foundItem.id);
--- a/calendar/providers/caldav/calDavRequestHandlers.js
+++ b/calendar/providers/caldav/calDavRequestHandlers.js
@@ -78,17 +78,17 @@ etagsHandler.prototype = {
             if (this.calendar.isCached && this.changeLogListener) {
                 this.changeLogListener.onResult({ status: Components.results.NS_ERROR_FAILURE },
                                                 Components.results.NS_ERROR_FAILURE);
             }
             this._reader = null;
         }
     },
 
-    onStopRequest: Task.async(function*(request, context, statusCode) {
+    onStopRequest: Task.async(function* (request, context, statusCode) {
         if (this.calendar.verboseLogging()) {
             cal.LOG("CalDAV: recv: " + this.logXML);
         }
         if (!this._reader) {
             // No reader means there was a request error
             return;
         }
         try {
--- a/calendar/providers/memory/calMemoryCalendar.js
+++ b/calendar/providers/memory/calMemoryCalendar.js
@@ -103,20 +103,20 @@ calMemoryCalendar.prototype = {
     // readonly attribute AUTF8String type;
     get type() { return "memory"; },
 
     // void addItem( in calIItemBase aItem, in calIOperationListener aListener );
     addItem: function (aItem, aListener) {
         var newItem = aItem.clone();
         return this.adoptItem(newItem, aListener);
     },
-    
+
     // void adoptItem( in calIItemBase aItem, in calIOperationListener aListener );
     adoptItem: function (aItem, aListener) {
-        if (this.readOnly) 
+        if (this.readOnly)
             throw Components.interfaces.calIErrors.CAL_IS_READONLY;
         if (aItem.id == null && aItem.isMutable)
             aItem.id = cal.getUUID();
 
         if (aItem.id == null) {
             this.notifyOperationComplete(aListener,
                                          Components.results.NS_ERROR_FAILURE,
                                          Components.interfaces.calIOperationListener.ADD,
@@ -160,17 +160,17 @@ calMemoryCalendar.prototype = {
                                      aItem.id,
                                      aItem);
         // notify observers
         this.mObservers.notify("onAddItem", [aItem]);
     },
 
     // void modifyItem( in calIItemBase aNewItem, in calIItemBase aOldItem, in calIOperationListener aListener );
     modifyItem: function (aNewItem, aOldItem, aListener) {
-        if (this.readOnly) 
+        if (this.readOnly)
             throw Components.interfaces.calIErrors.CAL_IS_READONLY;
         if (!aNewItem) {
             throw Components.results.NS_ERROR_INVALID_ARG;
         }
 
         var this_ = this;
         function reportError(errStr, errId) {
             this_.notifyOperationComplete(aListener,
@@ -279,17 +279,17 @@ calMemoryCalendar.prototype = {
                 this.notifyOperationComplete(aListener,
                                              Components.results.NS_ERROR_FAILURE,
                                              Components.interfaces.calIOperationListener.DELETE,
                                              aItem.id,
                                              "generation mismatch in deleteItem");
                 return;
             }
         }
-            
+
 
         delete this.mItems[aItem.id];
         this.mMetaData.deleteProperty(aItem.id);
 
         this.notifyOperationComplete(aListener,
                                      Components.results.NS_OK,
                                      Components.interfaces.calIOperationListener.DELETE,
                                      aItem.id,
@@ -336,17 +336,17 @@ calMemoryCalendar.prototype = {
 
         this.notifyOperationComplete(aListener,
                                      Components.results.NS_OK,
                                      Components.interfaces.calIOperationListener.GET,
                                      aId,
                                      null);
     },
 
-    // void getItems( in unsigned long aItemFilter, in unsigned long aCount, 
+    // void getItems( in unsigned long aItemFilter, in unsigned long aCount,
     //                in calIDateTime aRangeStart, in calIDateTime aRangeEnd,
     //                in calIOperationListener aListener );
     getItems: function (aItemFilter, aCount,
                         aRangeStart, aRangeEnd, aListener) {
         let this_ = this;
         cal.postPone(function() {
                 this_.getItems_(aItemFilter, aCount, aRangeStart, aRangeEnd, aListener);
             });
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -668,46 +668,46 @@ calStorageCalendar.prototype = {
     },
     getItems_: function cSC_getItems_(aItemFilter, aCount,
                                       aRangeStart, aRangeEnd, aListener)
     {
         //var profStartTime = Date.now();
         if (!aListener)
             return;
 
-        var self = this;
+        let self = this;
 
-        var itemsFound = Array();
-        var startTime = -0x7fffffffffffffff;
+        let itemsFound = Array();
+        let startTime = -0x7fffffffffffffff;
         // endTime needs to be the max value a PRTime can be
-        var endTime = 0x7fffffffffffffff;
-        var count = 0;
+        let endTime = 0x7fffffffffffffff;
+        let count = 0;
         if (aRangeStart)
             startTime = aRangeStart.nativeTime;
         if (aRangeEnd)
             endTime = aRangeEnd.nativeTime;
 
-        var wantUnrespondedInvitations = ((aItemFilter & kCalICalendar.ITEM_FILTER_REQUEST_NEEDS_ACTION) != 0);
-        var superCal;
+        let wantUnrespondedInvitations = ((aItemFilter & kCalICalendar.ITEM_FILTER_REQUEST_NEEDS_ACTION) != 0);
+        let superCal;
         try {
             superCal = this.superCalendar.QueryInterface(Components.interfaces.calISchedulingSupport);
         } catch (exc) {
             wantUnrespondedInvitations = false;
         }
         function checkUnrespondedInvitation(item) {
-            var att = superCal.getInvitedAttendee(item);
+            let att = superCal.getInvitedAttendee(item);
             return (att && (att.participationStatus == "NEEDS-ACTION"));
         }
 
-        var wantEvents = ((aItemFilter & kCalICalendar.ITEM_FILTER_TYPE_EVENT) != 0);
-        var wantTodos = ((aItemFilter & kCalICalendar.ITEM_FILTER_TYPE_TODO) != 0);
-        var asOccurrences = ((aItemFilter & kCalICalendar.ITEM_FILTER_CLASS_OCCURRENCES) != 0);
-        var wantOfflineDeletedItems = ((aItemFilter & kCalICalendar.ITEM_FILTER_OFFLINE_DELETED) != 0);
-        var wantOfflineCreatedItems = ((aItemFilter & kCalICalendar.ITEM_FILTER_OFFLINE_CREATED) != 0);
-        var wantOfflineModifiedItems = ((aItemFilter & kCalICalendar.ITEM_FILTER_OFFLINE_MODIFIED) != 0);
+        let wantEvents = ((aItemFilter & kCalICalendar.ITEM_FILTER_TYPE_EVENT) != 0);
+        let wantTodos = ((aItemFilter & kCalICalendar.ITEM_FILTER_TYPE_TODO) != 0);
+        let asOccurrences = ((aItemFilter & kCalICalendar.ITEM_FILTER_CLASS_OCCURRENCES) != 0);
+        let wantOfflineDeletedItems = ((aItemFilter & kCalICalendar.ITEM_FILTER_OFFLINE_DELETED) != 0);
+        let wantOfflineCreatedItems = ((aItemFilter & kCalICalendar.ITEM_FILTER_OFFLINE_CREATED) != 0);
+        let wantOfflineModifiedItems = ((aItemFilter & kCalICalendar.ITEM_FILTER_OFFLINE_MODIFIED) != 0);
 
         if (!wantEvents && !wantTodos) {
             // nothing to do
             this.notifyOperationComplete(aListener,
                                          Components.results.NS_OK,
                                          Components.interfaces.calIOperationListener.GET,
                                          null,
                                          null);
@@ -718,31 +718,31 @@ calStorageCalendar.prototype = {
         // Hence we need to update the mRecEventCacheOfflineFlags and  mRecTodoCacheOfflineFlags hash-tables
         // It can be an expensive operation but is only used in Online Reconciliation mode
         if (wantOfflineCreatedItems | wantOfflineDeletedItems | wantOfflineModifiedItems) {
             this.mRecItemCacheInited = false;
         }
 
         this.assureRecurringItemCaches();
 
-        var itemCompletedFilter = ((aItemFilter & kCalICalendar.ITEM_FILTER_COMPLETED_YES) != 0);
-        var itemNotCompletedFilter = ((aItemFilter & kCalICalendar.ITEM_FILTER_COMPLETED_NO) != 0);
+        let itemCompletedFilter = ((aItemFilter & kCalICalendar.ITEM_FILTER_COMPLETED_YES) != 0);
+        let itemNotCompletedFilter = ((aItemFilter & kCalICalendar.ITEM_FILTER_COMPLETED_NO) != 0);
 
         function checkCompleted(item) {
             return (item.isCompleted ? itemCompletedFilter : itemNotCompletedFilter);
         }
 
         // sending items to the listener 1 at a time sucks. instead,
         // queue them up.
         // if we ever have more than maxQueueSize items outstanding,
         // call the listener.  Calling with null theItems forces
         // a send and a queue clear.
-        var maxQueueSize = 10;
-        var queuedItems = [ ];
-        var queuedItemsIID;
+        let maxQueueSize = 10;
+        let queuedItems = [];
+        let queuedItemsIID;
         function queueItems(theItems, theIID) {
             // if we're about to start sending a different IID,
             // flush the queue
             if (theIID && queuedItemsIID != theIID) {
                 if (queuedItemsIID)
                     queueItems(null);
                 queuedItemsIID = theIID;
             }
@@ -761,17 +761,17 @@ calStorageCalendar.prototype = {
 
                 queuedItems = [ ];
             }
         }
 
         // helper function to handle converting a row to an item,
         // expanding occurrences, and queue the items for the listener
         function handleResultItem(item, theIID, optionalFilterFunc) {
-            var expandedItems = [];
+            let expandedItems = [];
             if (item.recurrenceInfo && asOccurrences) {
                 // If the item is recurring, get all ocurrences that fall in
                 // the range. If the item doesn't fall into the range at all,
                 // this expands to 0 items.
                 expandedItems = item.recurrenceInfo.getOccurrences(aRangeStart, aRangeEnd, 0, {});
                 if (wantUnrespondedInvitations) {
                     expandedItems = expandedItems.filter(checkUnrespondedInvitation);
                 }
@@ -807,18 +807,18 @@ calStorageCalendar.prototype = {
                 return true;
             }
 
             return false;
         }
 
         // First fetch all the events
         if (wantEvents) {
-            var sp;             // stmt params
-            var resultItems = [];
+            let sp;             // stmt params
+            let resultItems = [];
 
             // first get non-recurring events that happen to fall within the range
             //
             try {
                 this.prepareStatement(this.mSelectNonRecurringEventsByRange);
                 sp = this.mSelectNonRecurringEventsByRange.params;
                 sp.range_start = startTime;
                 sp.range_end = endTime;
@@ -836,17 +836,17 @@ calStorageCalendar.prototype = {
                 }
             } catch (e) {
                 this.logError("Error selecting non recurring events by range!\n", e);
             } finally {
                 this.mSelectNonRecurringEventsByRange.reset();
             }
 
             // Process the non-recurring events:
-            for (var evitem of resultItems) {
+            for (let evitem of resultItems) {
                 count += handleResultItem(evitem, Components.interfaces.calIEvent);
                 if (checkCount()) {
                     return;
                 }
             }
 
             // Process the recurring events from the cache
             for (let id in this.mRecEventCache) {
@@ -861,18 +861,18 @@ calStorageCalendar.prototype = {
                         return;
                     }
                 }
             }
         }
 
         // if todos are wanted, do them next
         if (wantTodos) {
-            var sp;             // stmt params
-            var resultItems = [];
+            let sp;             // stmt params
+            let resultItems = [];
 
             // first get non-recurring todos that happen to fall within the range
             try {
                 this.prepareStatement(this.mSelectNonRecurringTodosByRange);
                 sp = this.mSelectNonRecurringTodosByRange.params;
                 sp.range_start = startTime;
                 sp.range_end = endTime;
                 sp.start_offset = aRangeStart ? aRangeStart.timezoneOffset * USECS_PER_SECOND : 0;
@@ -888,17 +888,17 @@ calStorageCalendar.prototype = {
                 }
             } catch (e) {
                 this.logError("Error selecting non recurring todos by range", e);
             } finally {
                 this.mSelectNonRecurringTodosByRange.reset();
             }
 
             // process the non-recurring todos:
-            for (var todoitem of resultItems) {
+            for (let todoitem of resultItems) {
                 count += handleResultItem(todoitem, Components.interfaces.calITodo, checkCompleted);
                 if (checkCount()) {
                     return;
                 }
             }
 
             // Note: Reading the code, completed *occurrences* seems to be broken, because
             //       only the parent item has been filtered; I fixed that.
@@ -1655,20 +1655,20 @@ calStorageCalendar.prototype = {
     // after we get the base item, we need to check if we need to pull in
     // any extra data from other tables.  We do that here.
 
     // We used to use mDBTwo for this, so this can be run while a
     // select is executing but this no longer seems to be required.
 
     getAdditionalDataForItem: function cSC_getAdditionalDataForItem(item, flags) {
         // This is needed to keep the modification time intact.
-        var savedLastModifiedTime = item.lastModifiedTime;
+        let savedLastModifiedTime = item.lastModifiedTime;
 
         if (flags & CAL_ITEM_FLAG.HAS_ATTENDEES) {
-            var selectItem = null;
+            let selectItem = null;
             if (item.recurrenceId == null) {
                 selectItem = this.mSelectAttendeesForItem;
             } else {
                 selectItem = this.mSelectAttendeesForItemWithRecurrenceId;
                 this.setDateParamHelper(selectItem.params, "recurrence_id", item.recurrenceId);
             }
 
             try {
@@ -1690,55 +1690,55 @@ calStorageCalendar.prototype = {
             } catch (e) {
                 this.logError("Error getting attendees for item '" +
                               item.title + "' (" + item.id + ")!", e);
             } finally {
                 selectItem.reset();
             }
         }
 
-        var row;
+        let row;
         if (flags & CAL_ITEM_FLAG.HAS_PROPERTIES) {
-            var selectItem = null;
+            let selectItem = null;
             if (item.recurrenceId == null) {
                 selectItem = this.mSelectPropertiesForItem;
             } else {
                 selectItem = this.mSelectPropertiesForItemWithRecurrenceId;
                 this.setDateParamHelper(selectItem.params, "recurrence_id", item.recurrenceId);
             }
 
             try {
                 this.prepareStatement(selectItem);
                 selectItem.params.item_id = item.id;
                 while (selectItem.executeStep()) {
                     row = selectItem.row;
-                    var name = row.key;
+                    let name = row.key;
                     switch (name) {
                         case "DURATION":
                             // for events DTEND/DUE is enforced by calEvent/calTodo, so suppress DURATION:
                             break;
                         case "CATEGORIES": {
-                            var cats = categoriesStringToArray(row.value);
+                            let cats = categoriesStringToArray(row.value);
                             item.setCategories(cats.length, cats);
                             break;
                         }
                         default:
                             item.setProperty(name, row.value);
                             break;
                     }
                 }
             } catch (e) {
                 this.logError("Error getting extra properties for item '" +
                               item.title + "' (" + item.id + ")!", e);
             } finally {
                 selectItem.reset();
             }
         }
 
-        var i;
+        let i;
         if (flags & CAL_ITEM_FLAG.HAS_RECURRENCE) {
             if (item.recurrenceId) {
                 throw Components.results.NS_ERROR_UNEXPECTED;
             }
 
             let recInfo = cal.createRecurrenceInfo(item);
             item.recurrenceInfo = recInfo;
 
@@ -1760,40 +1760,40 @@ calStorageCalendar.prototype = {
 
         if (flags & CAL_ITEM_FLAG.HAS_EXCEPTIONS) {
             // it's safe that we don't run into this branch again for exceptions
             // (getAdditionalDataForItem->get[Event|Todo]FromRow->getAdditionalDataForItem):
             // every excepton has a recurrenceId and isn't flagged as CAL_ITEM_FLAG.HAS_EXCEPTIONS
             if (item.recurrenceId)
                 throw Components.results.NS_ERROR_UNEXPECTED;
 
-            var rec = item.recurrenceInfo;
+            let rec = item.recurrenceInfo;
 
             if (cal.isEvent(item)) {
                 this.mSelectEventExceptions.params.id = item.id;
                 this.prepareStatement(this.mSelectEventExceptions);
                 try {
                     while (this.mSelectEventExceptions.executeStep()) {
-                        var row = this.mSelectEventExceptions.row;
-                        var exc = this.getEventFromRow(row, {}, true /*isException*/);
+                        let row = this.mSelectEventExceptions.row;
+                        let exc = this.getEventFromRow(row, {}, true /*isException*/);
                         rec.modifyException(exc, true);
                     }
                 } catch (e) {
                     this.logError("Error getting exceptions for event '" +
                                   item.title + "' (" + item.id + ")!", e);
                 } finally {
                     this.mSelectEventExceptions.reset();
                 }
             } else if (cal.isToDo(item)) {
                 this.mSelectTodoExceptions.params.id = item.id;
                 this.prepareStatement(this.mSelectTodoExceptions);
                 try {
                     while (this.mSelectTodoExceptions.executeStep()) {
-                        var row = this.mSelectTodoExceptions.row;
-                        var exc = this.getTodoFromRow(row, {}, true /*isException*/);
+                        let row = this.mSelectTodoExceptions.row;
+                        let exc = this.getTodoFromRow(row, {}, true /*isException*/);
                         rec.modifyException(exc, true);
                     }
                 } catch (e) {
                     this.logError("Error getting exceptions for task '" +
                                   item.title + "' (" + item.id + ")!", e);
                 } finally {
                     this.mSelectTodoExceptions.reset();
                 }
--- a/calendar/providers/storage/calStorageHelpers.jsm
+++ b/calendar/providers/storage/calStorageHelpers.jsm
@@ -51,22 +51,26 @@ function getInUtcOrKeepFloating(dt) {
 
 /**
  * Transforms a date object to a text which is suitable for the database
  *
  * @param d     The calIDateTime to transform.
  * @return      The string representation of the date object.
  */
 function dateToText(d) {
-    let datestr;
-    let tz = null;
+    let zonestr;
+    if (d.timezone.isFloating) {
+        zonestr = "L";
+    } else if (d.timezone.isUTC) {
+        zonestr = "U";
+    } else {
+        zonestr = "Z";
+    }
 
-    datestr = (d.timezone.isFloating ? "L" :
-                 (d.timezone.isUTC ? "U" : "Z")) +
-              (d.isDate ? "D" : "T") + d.nativeTime;
+    let datestr = zonestr + (d.isDate ? "D" : "T") + d.nativeTime;
     if (!d.timezone.isFloating && ! d.timezone.isUTC) {
         datestr += ":" + d.timezone.tzid.replace(/%/g, "%%").replace(/:/g, "%:");
     }
     return datestr;
 }
 
 /**
  * Transforms the text representation of this date object to a calIDateTime
--- a/calendar/providers/storage/calStorageUpgrade.jsm
+++ b/calendar/providers/storage/calStorageUpgrade.jsm
@@ -259,16 +259,17 @@ function createDBDelegate(funcName) {
             try {
                 return db[funcName](...args);
             } catch (e) {
                 cal.ERROR("Error calling '" + funcName + "' db error: '" +
                           lastErrorString(db) + "'.\nException: " + e);
                 cal.WARN(cal.STACK(10));
             }
         }
+        return null;
     };
 }
 
 /**
  * Creates a delegate function for a database getter. Returns a function that
  * can be called to get the specified attribute, if a database is passed. If no
  * database is passed, no error is thrown but null is returned.
  *
--- a/calendar/providers/wcap/calWcapCalendar.js
+++ b/calendar/providers/wcap/calWcapCalendar.js
@@ -196,17 +196,17 @@ calWcapCalendar.prototype = {
     },
     refresh: function calWcapCalendar_refresh() {
         log("refresh.", this);
         // invalidate cached results:
         delete this.m_cachedResults;
         // notify about refreshed calendar:
         this.notifyObservers("onLoad", [this]);
     },
-    
+
     issueNetworkRequest: function calWcapCalendar_issueNetworkRequest(
         request, respFunc, dataConvFunc, wcapCommand, params, accessRights) {
 
         var this_ = this;
         // - bootstrap problem: no cal_props, no access check, no default calId
         // - assure being logged in, thus the default cal_props are available
         // - every subscribed calendar will come along with cal_props
         return this.session.getSessionId(
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -355,35 +355,36 @@ function calWcapCalendar_storeItem(bAddI
         // - if first occurrence is an exception
         //   and an EXDATE for that occurrence ought to be written,
         //   then the master item's data is replaced with that EXDATEd exception. WTF.
         // - if start/end date is being written on master, the previously EXDATEd
         //   exception overwrites master, why ever.
         // So in these cases: write all data of master.
 
         var bIsAllDay = false;
+        var dtstart, dtend;
         if (bIsEvent) {
-            var dtstart = item.startDate;
-            var dtend = item.endDate;
+            dtstart = item.startDate;
+            dtend = item.endDate;
             bIsAllDay = (dtstart.isDate && dtend.isDate);
             if (!oldItem || !identicalDatetimes(dtstart, oldItem.startDate)
                          || !identicalDatetimes(dtend, oldItem.endDate)) {
                 params += ("&dtstart=" + getIcalUTC(dtstart)); // timezone will be set with tzid param
                 params += ("&dtend=" + getIcalUTC(dtend));
                 params += (bIsAllDay ? "&isAllDay=1" : "&isAllDay=0");
 
                 if (bIsParent && item.recurrenceInfo) {
                     oldItem = null; // recurrence/exceptions hack: write whole master
                 }
             }
         } else { // calITodo
             // xxx todo: dtstart is mandatory for cs, so if this is
             //           undefined, assume an allDay todo???
-            var dtstart = item.entryDate;
-            var dtend = item.dueDate;
+            dtstart = item.entryDate;
+            dtend = item.dueDate;
 
             // cs bug: enforce DUE (set to DTSTART) if alarm is set
             if (!dtend && item.getAlarms({}).length) {
                 dtend = dtstart;
             }
 
             bIsAllDay = (dtstart && dtstart.isDate);
             if (!oldItem || !identicalDatetimes(dtstart, oldItem.entryDate)
@@ -513,17 +514,17 @@ function calWcapCalendar_storeItem(bAddI
                 params += ("&percent=" + item.percentComplete.toString(10));
             }
             if (!oldItem || !equalDatetimes(item.completedDate, oldItem.completedDate)) {
                 params += ("&completed=" + getIcalUTC(item.completedDate));
             }
         }
 
         // attachment urls:
-        var val = getAttachments(item);
+        val = getAttachments(item);
         if (!oldItem || val != getAttachments(oldItem)) {
             params += ("&attachments=" + val);
         }
     } // PUBLISH, REQUEST
 
     var alarmParams = this.getAlarmParams(item);
     if (!oldItem || (this.getAlarmParams(oldItem) != alarmParams)) {
         if ((method == METHOD_REQUEST) && params.length == 0) {
@@ -1079,17 +1080,17 @@ function calWcapCalendar_getItem(id, lis
                                           "unexpected number of items: " + items.length);
                     }
                     if (listener) {
                         listener.onGetResult(this_.superCalendar, NS_OK,
                                              calIItemBase, log("getItem(): success. id=" + id, this_),
                                              items.length, items);
                     }
                     request.execRespFunc(null, items[0]);
-                };
+                }
                 if (err) {
                     if (!checkErrorCode(err, calIWcapErrors.WCAP_FETCH_EVENTS_BY_ID_FAILED) &&
                         !checkErrorCode(err, calIWcapErrors.WCAP_COMPONENT_NOT_FOUND)) {
                         throw err;
                     }
                     // try todos:
                     this_.issueNetworkRequest(
                         request,
@@ -1350,33 +1351,33 @@ function calWcapCalendar_replayChangesOn
                 if (!Components.isSuccessCode(status)) {
                     request.execRespFunc(status); // any error on writing breaks whole operation
                 }
             }
         };
         var request = new calWcapRequest(
             function netFinishedRespFunc(err, data) {
                 var modifiedIds = {};
-                for (var item of request.m_modifiedItems) {
+                for (let item of request.m_modifiedItems) {
                     var dtCreated = item.getProperty("CREATED");
                     var bAdd = (!dtCreated || !dtFrom || dtCreated.compare(dtFrom) >= 0);
                     modifiedIds[item.id] = true;
                     if (bAdd) {
                         log("replayChangesOn(): new item " + item.id, this_);
                         if (this_.offlineStorage) {
                             this_.offlineStorage.addItem(item, writeListener);
                         }
                     } else {
                         log("replayChangesOn(): modified item " + item.id, this_);
                         if (this_.offlineStorage) {
                             this_.modifyItem(item, null, writeListener);
                         }
                     }
                 }
-                for (var item of request.m_deletedItems) {
+                for (let item of request.m_deletedItems) {
                     // don't delete anything that has been touched by lastmods:
                     if (modifiedIds[item.id]) {
                         log("replayChangesOn(): skipping deletion of " + item.id, this_);
                     } else if (isParent(item)) {
                         log("replayChangesOn(): deleted item " + item.id, this_);
                         if (this_.offlineStorage) {
                             this_.offlineStorage.deleteItem(item, writeListener);
                         }
--- a/calendar/providers/wcap/calWcapCalendarModule.js
+++ b/calendar/providers/wcap/calWcapCalendarModule.js
@@ -37,17 +37,17 @@ var g_busyPhantomItemUuidPrefix;
 var CACHE_LAST_RESULTS = 4;
 // timer secs for invalidation:
 var CACHE_LAST_RESULTS_INVALIDATE = 120;
 
 // logging:
 var LOG_LEVEL = 0;
 
 function initWcapProvider() {
-    try {        
+    try {
         initLogging();
 
         // some string resources:
         g_privateItemTitle = cal.calGetString("wcap", "privateItem.title.text");
         g_confidentialItemTitle = cal.calGetString("wcap", "confidentialItem.title.text");
         g_busyItemTitle = cal.calGetString("wcap", "busyItem.title.text");
         g_busyPhantomItemUuidPrefix = ("PHANTOM_uuid_" + cal.getUUID());
 
--- a/calendar/providers/wcap/calWcapSession.js
+++ b/calendar/providers/wcap/calWcapSession.js
@@ -478,26 +478,25 @@ calWcapSession.prototype = {
             },
             log("setupSession", this));
         if (request_) {
             request_.attachSubRequest(request);
         }
 
         request.lockPending();
         try {
-            var this_ = this;
             this.issueNetworkRequest_(
                 request,
                 function userprefs_resp(err, data) {
                     if (err)
                         throw err;
                     this_.credentials.userPrefs = data;
                     log("installed user prefs.", this_);
 
-                    // get calprops for all registered calendars:                        
+                    // get calprops for all registered calendars:
                     var cals = this_.getRegisteredCalendars(true);
 
                     var calprops_resp = null;
                     var defaultCal = this_.defaultCalendar;
                     if (defaultCal && cals[defaultCal.calId] && // default calendar is registered
                         getPref("calendar.wcap.subscriptions", true) &&
                         !defaultCal.getProperty("subscriptions_registered")) {
 
@@ -550,17 +549,17 @@ calWcapSession.prototype = {
                 sessionId);
             this.installServerTimeDiff(sessionId, request);
             this.installServerTimezones(sessionId, request);
 
         } finally {
             request.unlockPending();
         }
     },
-    
+
     installCalProps_get_calprops:
     function calWcapSession_installCalProps_get_calprops(respFunc, sessionId, cals, request) {
 
         var this_ = this;
         function calprops_resp(err, data) {
             if (err) {
                 throw err;
             }
@@ -1139,32 +1138,32 @@ function confirmInsecureLogin(uri)
     var host = uri.hostPort;
     var encodedHost = encodeURIComponent(host);
     var confirmedEntry = confirmInsecureLogin.m_confirmedHttpLogins[encodedHost];
     if (confirmedEntry) {
         bConfirmed = (confirmedEntry == "1");
     } else {
         var prompt = Services.ww.getNewPrompter(null);
         var out_dontAskAgain = { value: false };
-        var bConfirmed = prompt.confirmCheck(
+        bConfirmed = prompt.confirmCheck(
             cal.calGetString("wcap", "noHttpsConfirmation.label"),
             cal.calGetString("wcap", "noHttpsConfirmation.text", [host]),
             cal.calGetString("wcap", "noHttpsConfirmation.check.text"),
             out_dontAskAgain);
 
         if (out_dontAskAgain.value) {
             // save decision for all running calendars and
             // all future confirmations:
-            var confirmedHttpLogins = getPref("calendar.wcap.confirmed_http_logins", "");
-            if (confirmedHttpLogins.length > 0) {
-                confirmedHttpLogins += ",";
+            var newConfirmedLogins = getPref("calendar.wcap.confirmed_http_logins", "");
+            if (newConfirmedLogins.length > 0) {
+                newConfirmedLogins += ",";
             }
             confirmedEntry = (bConfirmed ? "1" : "0");
-            confirmedHttpLogins += (encodedHost + ":" + confirmedEntry);
-            Preferences.set("calendar.wcap.confirmed_http_logins", confirmedHttpLogins);
+            newConfirmedLogins += (encodedHost + ":" + confirmedEntry);
+            Preferences.set("calendar.wcap.confirmed_http_logins", newConfirmedLogins);
             getPref("calendar.wcap.confirmed_http_logins"); // log written entry
             confirmInsecureLogin.m_confirmedHttpLogins[encodedHost] = confirmedEntry;
         }
     }
 
     log("returned: " + bConfirmed, "confirmInsecureLogin(" + host + ")");
     return bConfirmed;
 }
--- a/calendar/providers/wcap/calWcapUtils.js
+++ b/calendar/providers/wcap/calWcapUtils.js
@@ -14,17 +14,17 @@ function initLogging() {
     if (initLogging.mLogFilestream) {
         try {
             initLogging.mLogFilestream.close();
         } catch (exc) {
             ASSERT(false, exc);
         }
         initLogging.mLogFilestream = null;
     }
-    
+
     LOG_LEVEL = getPref("calendar.wcap.log_level", 0);
     if (LOG_LEVEL < 1 && getPref("calendar.debug.log", false)) {
         LOG_LEVEL = 1; // at least basic logging when calendar.debug.log is set
     }
 
     if (LOG_LEVEL > 0) {
         var logFileName = getPref("calendar.wcap.log_file", null);
         if (logFileName) {
--- a/calendar/resources/content/datetimepickers/datetimepickers.xml
+++ b/calendar/resources/content/datetimepickers/datetimepickers.xml
@@ -2,32 +2,30 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!--
-/*  This defines <datepicker/> <timepicker/> and <datetimepicker/>
+    This defines <datepicker/> <timepicker/> and <datetimepicker/>
     which all descend from datetimepicker-base to get date/time parsing
     and consistent behavior.
     It relies on <minimonth/> for the date picker's drop down.
     You can be notified of change event as follows:
       <datepicker id="my-date-picker" onchange="myDatePick( this );"/>
     May get/set value in javascript with
       document.getElementById("my-date-picker").value = new Date();
     May disable/enable in javascript with
       document.getElementById("my-date-picker").disabled = true;
     May also disable/enable a datetimepicker's component
       datepicker or timepicker individually with
       document.getElementById("my-datetimepicker").datepickerdisabled = true;
       document.getElementById("my-datetimepicker").timepickerdisabled = true;
-
-*/
 -->
 <bindings id="xulDatePicker"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xbl="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="datetextpicker"
            extends="chrome://calendar/content/datetimepickers/datetimepickers.xml#datetimepicker-base">
@@ -161,28 +159,28 @@
            val = val.replace(',', '');
 
            if (!val.includes(' ')) {
              // Just a single word, or a single date.
              return getDateForDay(val);
            }
 
            // Replace month names with numbers
-           for (var i in this.mMonthLongNames) {
+           for (let i in this.mMonthLongNames) {
              if (val.includes(this.mMonthLongNames[i])) {
-               var 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 (var i in this.mMonthShortNames) {
+           for (let i in this.mMonthShortNames) {
              if (val.includes(this.mMonthShortNames[i])) {
-               var 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;
@@ -614,17 +612,17 @@
               this.mValue = aValue;
             }
             // set textBox.value property, not attribute
             this.kTextBox.value = this.formatTime(this.mValue);
 
             if (aValue != null && aRefresh && timeChanged) {
               let event = document.createEvent('Events');
               event.initEvent("change", true, true);
-              this.dispatchEvent(event);;
+              this.dispatchEvent(event);
             }
           ]]>
         </body>
       </method>
 
       <method name="parseTextBoxTime">
         <parameter name="aRefresh"/>
         <parameter name="aEvent"/>
--- a/calendar/resources/content/publish.js
+++ b/calendar/resources/content/publish.js
@@ -37,45 +37,45 @@ function publishCalendarDataDialogRespon
  * Show publish dialog, ask for URL and publish all items from the calendar.
  *
  * @param aCalendar   (optional) The calendar that will be published. If ommitted
  *                               the user will be prompted to select a calendar.
  */
 function publishEntireCalendar(aCalendar)
 {
     if (!aCalendar) {
-        var count = new Object();
-        var calendars = getCalendarManager().getCalendars(count);
+        let count = {};
+        let calendars = getCalendarManager().getCalendars(count);
 
         if (count.value == 1) {
             // Do not ask user for calendar if only one calendar exists
             aCalendar = calendars[0];
         } else {
             // Ask user to select the calendar that should be published.
             // publishEntireCalendar() will be called again if OK is pressed
             // in the dialog and the selected calendar will be passed in.
             // Therefore return after openDialog().
-            var args = new Object();
+            let args = new Object();
             args.onOk = publishEntireCalendar;
             args.promptText = calGetString("calendar", "publishPrompt");
             openDialog("chrome://calendar/content/chooseCalendarDialog.xul",
                        "_blank", "chrome,titlebar,modal,resizable", args);
             return;
         }
     }
 
-    var args = new Object();
-    var publishObject = new Object( );
+    let args = {};
+    let publishObject = {};
 
     args.onOk =  self.publishEntireCalendarDialogResponse;
 
     publishObject.calendar = aCalendar;
 
     // restore the remote ics path preference from the calendar passed in
-    var remotePath = aCalendar.getProperty("remote-ics-path");
+    let remotePath = aCalendar.getProperty("remote-ics-path");
     if (remotePath && remotePath.length && remotePath.length > 0) {
         publishObject.remotePath = remotePath;
     }
 
     args.publishObject = publishObject;
     openDialog("chrome://calendar/content/publishDialog.xul", "caPublishEvents",
                "chrome,titlebar,modal,resizable", args );
 
--- a/calendar/resources/content/publishDialog.js
+++ b/calendar/resources/content/publishDialog.js
@@ -18,33 +18,33 @@ var gPublishObject;
 
 /**
 *   Called when the dialog is loaded.
 */
 
 function loadCalendarPublishDialog()
 {
    // Get arguments, see description at top of file
-   
+
    var args = window.arguments[0];
-   
+
    gOnOkFunction = args.onOk;
-   
+
    if( args.publishObject )
    {
       gPublishObject = args.publishObject;
       if ( args.publishObject.remotePath )
           document.getElementById( "publish-remotePath-textbox" ).value = args.publishObject.remotePath;
    }
    else
    {
       gPublishObject = new Object();
    }
-   document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel );   
-   
+   document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", publishButtonLabel );
+
    checkURLField( );
 
    var firstFocus = document.getElementById( "publish-remotePath-textbox" );
    firstFocus.focus();
 }
 
 
 
@@ -53,17 +53,17 @@ function loadCalendarPublishDialog()
 */
 
 function onOKCommand()
 {
    gPublishObject.remotePath = document.getElementById( "publish-remotePath-textbox" ).value;
 
    // call caller's on OK function
    gOnOkFunction(gPublishObject, progressDialog);
-   document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", closeButtonLabel );   
+   document.getElementById( "calendar-publishwindow" ).getButton( "accept" ).setAttribute( "label", closeButtonLabel );
    document.getElementById( "calendar-publishwindow" ).setAttribute( "ondialogaccept", "closeDialog()" );
    return( false );
 }
 
 
 function checkURLField( )
 {
    if( document.getElementById( "publish-remotePath-textbox" ).value.length == 0 )
@@ -76,14 +76,14 @@ function closeDialog( )
 {
    self.close( );
 }
 
 var progressDialog = {
     onStartUpload: function() {
         document.getElementById( "publish-progressmeter" ).setAttribute( "mode", "undetermined" );
     },
-    
+
     onStopUpload: function() {
         document.getElementById( "publish-progressmeter" ).setAttribute( "mode", "determined" );
     }
 };
 progressDialog.wrappedJSObject = progressDialog;
--- a/calendar/test/mozmill/eventDialog/testEventDialog.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialog.js
@@ -34,41 +34,41 @@ var testEventDialog = function () {
     + 'anon({"anonid":"monthgridrows"})/[rowNumber]/[columnNumber]/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}/anon({"flex":"1"})/'
     + '[0]/anon({"anonid":"event-container"})/{"class":"calendar-event-selection"}/'
     + 'anon({"anonid":"eventbox"})/{"class":"calendar-event-details"}';
 
   // open month view
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   controller.waitThenClick(new elementslib.ID(controller.window.document, "calendar-month-view-button"));
-    
+
   // pick year
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"yearcell"})'));
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"years-popup"})/[0]/{"value":"2009"}'));
-  
+
   // pick month
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"monthheader"})'));
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"months-popup"})/[0]/{"index":"0"}'));
 
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
   controller.sleep(sleep);
-  
+
   // create new event
   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 ampm = "";
   if (now.toLocaleTimeString().match(/AM|PM/)) {
     ampm = (hour >= 12 ? " PM" : " AM")
@@ -81,179 +81,179 @@ var testEventDialog = function () {
   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"})/id("timepicker-text")/'
     + 'anon({"class":"menulist-editable-box textbox-input-box"})/anon({"anonid":"input"})'
     );
   event.waitForElement(startTimeInput);
   event.assertValue(startTimeInput, startTime);
-  
+
   // check selected calendar
   event.assertNode(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-category-color-row")/id("event-grid-category-box")/id("item-calendar")/[0]/'
     + '{"selected":"true","label":"' + calendar + '"}'))
-  
+
   // fill in name, location, description
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     title);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-location-row")/id("item-location")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'), location);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     desc);
-  
+
   // set category
   let categories = utils.getProperty("chrome://calendar/locale/categories.properties", "categories2");
   let category = categories.split(',')[4]; // pick 4th value in a comma-separated list
   event.select(new elementslib.ID(event.window.document, "item-categories"), null, category);
 
   // repeat daily
   event.click(new elementslib.ID(event.window.document, "repeat-daily-menuitem"));
-  
+
   // add reminder
   event.click(new elementslib.ID(event.window.document, "reminder-5minutes-menuitem"));
-  
+
   // add an attendee and verify added
   let md = new modalDialog.modalDialog(event.window);
   md.start(handleAttendees);
   event.click(new elementslib.ID(event.window.document, "button-attendees"));
   event.assertValue(new elementslib.ID(event.window.document, "attendee-list"),
     attendee);
-  
+
   // make it private and verify label visible
   event.click(new elementslib.ID(event.window.document, "button-privacy"));
   event.click(new elementslib.ID(event.window.document, "event-privacy-private-menuitem"));
   let label = (new elementslib.ID(event.window.document, "status-privacy-private-box"));
   event.assertJS(event.window.getComputedStyle(label.getNode(), null).getPropertyValue("visibility") == "visible");
-  
+
   // add attachment and verify added
   calUtils.handleAddingAttachment(event, url);
   event.click(new elementslib.ID(event.window.document, "button-url"));
   event.assertNode(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-attachment-row")/id("attachment-link")/{"label":"mozilla.org"}'));
-  
+
   // save
   calUtils.acceptSendingNotificationMail(event);
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // catch and dismiss alarm
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:AlarmWindow").length > 0}, sleep);
   let alarm = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:AlarmWindow")[0]);
   // dismiss all button, label in .dtd file, bug #504635
   alarm.waitThenClick(new elementslib.Lookup(alarm.window.document, '/id("calendar-alarm-dialog")/'
     + 'id("alarm-actionbar")/[1]'));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:AlarmWindow").length == 0}, sleep);
-  
+
   // verify event and alarm icon visible every day of the month and check tooltip
   // 1st January is Thursday so there's three days to check in the first row
-  controller.assertNode(new elementslib.Lookup(controller.window.document, 
+  controller.assertNode(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "4")));
   checkIcon(eventBox, "0", "4");
   checkTooltip(monthView, "0", "4", "1", startTime, endTime);
-  
-  controller.assertNode(new elementslib.Lookup(controller.window.document, 
+
+  controller.assertNode(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "5")));
   checkIcon(eventBox, "0", "5");
   checkTooltip(monthView, "0", "5", "2", startTime, endTime);
-  
-  controller.assertNode(new elementslib.Lookup(controller.window.document, 
+
+  controller.assertNode(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "6")));
   checkIcon(eventBox, "0", "6");
   checkTooltip(monthView, "0", "6", "3", startTime, endTime);
-  
+
   // 31st of January is Saturday so there's four more full rows to check
   let date = 4;
   for(row = 1; row < 5; row++){
     for(col = 0; col < 7; col++){
-        controller.assertNode(new elementslib.Lookup(controller.window.document, 
+        controller.assertNode(new elementslib.Lookup(controller.window.document,
           eventBox.replace("rowNumber", row).replace("columnNumber", col)));
         checkIcon(eventBox, row, col);
         checkTooltip(monthView, row, col, date, startTime, endTime);
         date++;
     }
   }
-  
+
   // delete and verify deleted 2nd Jan
   calUtils.handleOccurrenceDeletion(controller);
-  controller.click(new elementslib.Lookup(controller.window.document, 
+  controller.click(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "5")));
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
-  controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, 
+  controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "5")));
-  
+
   // verify all others still exist
-  controller.assertNode(new elementslib.Lookup(controller.window.document, 
+  controller.assertNode(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "4")));
-  controller.assertNode(new elementslib.Lookup(controller.window.document, 
+  controller.assertNode(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "6")));
-    
+
   for(row = 1; row < 5; row++)
     for(col = 0; col < 7; col++)
-        controller.assertNode(new elementslib.Lookup(controller.window.document, 
+        controller.assertNode(new elementslib.Lookup(controller.window.document,
           eventBox.replace("rowNumber", row).replace("columnNumber", col)));
-  
+
   // delete series by deleting 3rd January and confirming to delete all
   calUtils.handleParentDeletion(controller);
-  controller.click(new elementslib.Lookup(controller.window.document, 
+  controller.click(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "6")));
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
-  
+
   // verify all deleted
-  controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, 
+  controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "4")));
-  controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, 
+  controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "5")));
-  controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, 
+  controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "6")));
-    
+
   for(row = 1; row < 5; row++)
     for(col = 0; col < 7; col++)
-        controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, 
+        controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
           eventBox.replace("rowNumber", row).replace("columnNumber", col)));
 }
 
 function handleAttendees(attendees){
   let input = new elementslib.Lookup(attendees.window.document,
     '/id("calendar-event-dialog-attendees-v2")/[6]/[0]/id("attendees-list")/'
     + 'anon({"anonid":"listbox"})/[1]/[1]/anon({"anonid":"input"})/'
     + 'anon({"class":"autocomplete-textbox-container"})/'
     + '{"class":"textbox-input-box"}/anon({"anonid":"input"})');
   attendees.waitForElement(input);
   attendees.type(input, attendee);
-  attendees.click(new elementslib.Lookup(attendees.window.document, 
+  attendees.click(new elementslib.Lookup(attendees.window.document,
     '/id("calendar-event-dialog-attendees-v2")/anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkIcon(eventBox, row, col){
   let icon = new elementslib.Lookup(controller.window.document,
     (eventBox + '/anon({"anonid":"category-box-stack"})/anon({"align": "right"})/anon({"class":"alarm-icons-box"})/anon({"class": "reminder-icon"})')
     .replace("rowNumber", row).replace("columnNumber", col));
   controller.assertJS(icon.getNode().getAttribute("value") == "DISPLAY");
 }
 
 function checkTooltip(monthView, row, col, date, startTime, endTime){
   let mouseOverItem = monthView + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/'
     + 'anon({"anonid":"monthgridrows"})/[rowNumber]/[columnNumber]/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  controller.mouseOver(new elementslib.Lookup(controller.window.document, 
+  controller.mouseOver(new elementslib.Lookup(controller.window.document,
           mouseOverItem.replace("rowNumber", row).replace("columnNumber", col)));
-  
+
   // check title
   let eventName = new elementslib.Lookup(controller.window.document,
     '/id("messengerWindow")/id("calendar-popupset")/id("itemTooltip")/'
     + '{"class":"tooltipBox"}/{"class":"tooltipHeaderGrid"}/[1]/[0]/[1]');
   controller.assertJS(eventName.getNode().textContent == title);
-  
+
   // check date and time
   // date-time string contains strings formatted in operating system language so check numeric values only
   let dateTime = new elementslib.Lookup(controller.window.document,
     '/id("messengerWindow")/id("calendar-popupset")/id("itemTooltip")/'
     + '{"class":"tooltipBox"}/{"class":"tooltipHeaderGrid"}/[1]/[2]/[1]').getNode().textContent + '';
   controller.assertJS(dateTime.includes(date) && dateTime.includes(startTime)
     && dateTime.includes(endTime));
 }
--- a/calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
@@ -27,116 +27,116 @@ var newlines = [{title: "title", descrip
                 {title: "title", description: "\ntest newline\n"},
                 {title: "title", description: "\rtest \\r\r"},
                 {title: "title", description: "\r\ntest \\r\\n\r\n"},
                 {title: "title", description: "\ttest \\t\t"}];
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
-  
+
   let categories = prefs.preferences.getPref("calendar.categories.names", "string").split(',');
   data[0].category = categories[0];
   data[1].category = categories[1];
 }
 
 // Test that closing an event dialog with no changes does not prompt for save
 var testEventDialogModificationPrompt = function () {
   controller.click(new elementslib.ID(controller.window.document,"calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   // create new event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, 8)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   // enter first set of data
   calUtils.setData(event, data[0]);
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // open, but change nothing
   let eventBox = new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)
     + '/{"tooltip":"itemTooltip"}');
   controller.waitForElement(eventBox);
   controller.doubleClick(eventBox);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   // modal dialog setup
   let md = new modalDialog.modalDialog(event.window);
   md.start(handleSavePrompt);
-  
+
   // escape the event window, there should be no prompt to save event
   event.keypress(undefined, "VK_ESCAPE", {});
   controller.sleep(sleep);
   md.stop();
-  
+
   // open
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)
     + '/{"tooltip":"itemTooltip"}'));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   // change all values
   calUtils.setData(event, data[1]);
-  
+
   // edit all values back to original
   calUtils.setData(event, data[0]);
-  
+
   // this is set up after data entry because otherwise it tries to handle attachment dialog
   md = new modalDialog.modalDialog(event.window);
   md.start(handleSavePrompt);
 
   // escape the event window, there should be no prompt to save event
   event.keypress(undefined, "VK_ESCAPE", {});
-  controller.sleep(sleep); 
+  controller.sleep(sleep);
   md.stop();
-  
+
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)));
-  
+
   for(let i = 0; i < newlines.length; i++) {
     // test set i
     controller.doubleClick(new elementslib.Lookup(controller.window.document,
       calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, 8)), 1, 1);
     controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
     event = new mozmill.controller.MozMillController(mozmill.utils
       .getWindows("Calendar:EventDialog")[0]);
     calUtils.setData(event, newlines[i]);
     event.click(new elementslib.ID(event.window.document, "button-save"));
-    
+
     // open and close
     eventBox = new elementslib.Lookup(controller.window.document,
       calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)
       + '/{"tooltip":"itemTooltip"}');
     controller.waitForElement(eventBox);
     controller.doubleClick(eventBox);
     controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
     event = new mozmill.controller.MozMillController(mozmill.utils
       .getWindows("Calendar:EventDialog")[0]);
     md = new modalDialog.modalDialog(event.window);
     md.start(handleSavePrompt);
     event.keypress(undefined, "VK_ESCAPE", {});
     controller.sleep(sleep);
     md.stop();
-    
+
     // delete it
     // XXX somehow the event is selected at this point, this didn't use to be the case
     // and can't be reproduced manually
     /*controller.click(new elementslib.Lookup(controller.window.document,
       calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)));*/
     controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
       "VK_DELETE", {});
     controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document,
--- a/calendar/test/mozmill/eventDialog/testUTF8.js
+++ b/calendar/test/mozmill/eventDialog/testUTF8.js
@@ -13,74 +13,74 @@ var UTF8string = "õäöü";
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, UTF8string);
   Preferences.set("calendar.categories.names", UTF8string);
 }
 
 var testUTF8 = function () {
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
-  
+
   controller.click(new elementslib.ID(controller.window.document,"calendar-tab-button"));
   calUtils.switchToView(controller, "day");
-  
+
   // create new event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, 8)));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // fill in name, location, description
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, UTF8string);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-location-row")/id("item-location")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     UTF8string);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     UTF8string);
-  
+
   // select category
   event.select(new elementslib.ID(event.window.document, "item-categories"), undefined,
     UTF8string);
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // open
   let eventBox = new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)
     + '/{"tooltip":"itemTooltip","calendar":"' + UTF8string.toLowerCase() + '"}');
   controller.waitForElement(eventBox);
   controller.doubleClick(eventBox);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // check values
   titleTextBox = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.assertValue(titleTextBox, UTF8string);
   event.assertValue(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-location-row")/id("item-location")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     UTF8string);
   event.assertValue(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     UTF8string);
   event.assertValue(new elementslib.ID(event.window.document, "item-categories"),
     UTF8string);
-  
+
   // escape the event window
   event.keypress(undefined, "VK_ESCAPE", {});
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, UTF8string);
   prefs.preferences.clearUserPref("calendar.categories.names");
 }
--- a/calendar/test/mozmill/recurrence/testAnnualRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testAnnualRecurrence.js
@@ -11,67 +11,67 @@ var epoch = 1970;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testAnnualRecurrence = function () {
   var eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   controller.sleep(sleep);
-  
+
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, startYear, 1, 1);
-  
+
   // create yearly recurring all-day event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
                  .getWindows("Calendar:EventDialog")[0]);
   event.sleep(sleep);
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "yearly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.sleep(sleep);
-  
+
   let checkYears = [startYear, startYear + 1, epoch - 1, epoch, epoch + 1];
   let box = "";
   for(let i = 0; i < checkYears.length; i++){
     calUtils.goToDate(controller, checkYears[i], 1, 1);
     let date = new Date(checkYears[i], 0, 1);
     let column = date.getDay() + 1;
-    
+
     // day view
     calUtils.switchToView(controller, "day");
     box = calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // week view
     calUtils.switchToView(controller, "week");
     box = calUtils.getEventBoxPath(controller, "week", calUtils.ALLDAY, undefined, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // multiweek view
     calUtils.switchToView(controller, "multiweek");
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.ALLDAY, 1, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // month view
     calUtils.switchToView(controller, "month");
     box = calUtils.getEventBoxPath(controller, "month", calUtils.ALLDAY, 1, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // delete event
   calUtils.goToDate(controller, checkYears[0], 1, 1);
   calUtils.switchToView(controller, "day");
   box = calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)
     + eventPath;
   calUtils.handleParentDeletion(controller, false);
   controller.click(new elementslib.Lookup(controller.window.document, box));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
--- a/calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
@@ -1,102 +1,102 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("../shared-modules/calendar-utils");
 
 var sleep = 500;
 var calendar = "Mozmill";
 var hour = 8;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testBiweeklyRecurrence = function () {
   var eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 31);
-  
+
   // create biweekly event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "bi.weekly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   // check day view
   for(let i = 0; i < 4; i++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 14);
   }
-  
+
   // check week view
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 31);
-  
+
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour)
     + eventPath;
   for(let i = 0; i < 4; i++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 2);
   }
 
   // check multiweek view
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 31);
-  
+
   // always two occurrences in view, 1st and 3rd or 2nd and 4th week
   for(let i = 0; i < 5; i++){
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i % 2 + 1, 7,
       undefined) + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i % 2 + 3, 7,
       undefined) + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 1);
   }
-  
+
   // check month view
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 31);
 
   // January
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 5, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 1);
-  
+
   // February
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 4, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 1);
-  
+
   // March
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 4, 7, undefined)
     + eventPath;
-  controller.assertNode(new elementslib.Lookup(controller.window.document, box));  
+  controller.assertNode(new elementslib.Lookup(controller.window.document, box));
 
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document, box));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 }
--- a/calendar/test/mozmill/recurrence/testDailyRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testDailyRecurrence.js
@@ -10,191 +10,191 @@ var hour = 8;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testDailyRecurrence = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   // create daily event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "daily");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // check day view for 7 days
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour, undefined)
     + eventPath;
   controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
-  
+
   for(let day = 1; day <= 7; day++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 1);
   }
-  
+
   // check week view for 2 weeks
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let day = 5; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, 1, day, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   calUtils.forward(controller, 1);
-  
+
   for(let day = 1; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, 2, day, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // check multiweek view for 4 weeks
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let day = 5; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, 1, day, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   for(let week = 2; week <= 4; week++){
     for(let day = 1; day <= 7; day++){
       let box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, week, day, hour)
         + eventPath;
       controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     }
   }
-  
+
   // check month view for all 5 weeks
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let day = 5; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 1, day, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   for(let week = 2; week <= 5; week++){
     for(let day = 1; day <= 7; day++){
       let box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, week, day, undefined)
         + eventPath;
       controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     }
   }
-  
+
   // delete 3rd January occurrence
   let saturday = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 1, 7, undefined)
     + eventPath;
   calUtils.handleOccurrenceDeletion(controller, false);
   controller.click(new elementslib.Lookup(controller.window.document, saturday));
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
-  
+
   // verify in all views
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, saturday));
-  
+
   calUtils.switchToView(controller, "multiweek");
   saturday = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, 1, 7, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, saturday));
-    
+
   calUtils.switchToView(controller, "week");
   saturday = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, saturday));
-    
+
   calUtils.switchToView(controller, "day");
   saturday = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, saturday));
-  
+
   // go to previous day to edit event to occur only on weekdays
   calUtils.back(controller, 1);
-  
+
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath));
-  
+
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "every.weekday");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // check day view for 7 days
   let day = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, undefined)
     + eventPath;
   var dates = [[2009, 1, 3],
                [2009, 1, 4]];
   for(let i = 0; i < dates.length; i++){
     calUtils.goToDate(controller, dates[i][0], dates[i][1], dates[i][2]);
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
   }
-  
+
   // check week view for 2 weeks
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let i = 0; i <= 1; i++){
     let day = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 1, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     day = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     calUtils.forward(controller, 1);
   }
-  
+
   // check multiweek view for 4 weeks
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let i = 1; i <= 4; i++){
     let day = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i, 1, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     day = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i, 7, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
   }
-  
+
   // check month view for all 5 weeks
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let i = 1; i <= 5; i++){
     let day = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, i, 1, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     day = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, i, 7, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
   }
-  
+
   // delete event
   day = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 1, 5, undefined)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, day));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, day));
--- a/calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
@@ -1,12 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("../shared-modules/calendar-utils");
 var modalDialog = require("../shared-modules/modal-dialog");
 
 var sleep = 500;
 var calendar = "Mozmill";
 var hour = 8;
 
 var setupModule = function(module) {
@@ -14,33 +14,33 @@ var setupModule = function(module) {
   calUtils.createCalendar(controller, calendar);
 }
 
 var testLastDayOfMonthRecurrence = function () {
   var eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2008, 1, 31); // start with a leap year
-  
+
   // create monthly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   //                        date     correct row in month view
   let checkingData = [[2008,  1, 31, 5],
                       [2008,  2, 29, 5],
                       [2008,  3, 31, 6],
                       [2008,  4, 30, 5],
                       [2008,  5, 31, 5],
                       [2008,  6, 30, 5],
                       [2008,  7, 31, 5],
@@ -48,77 +48,77 @@ var testLastDayOfMonthRecurrence = funct
                       [2008,  9, 30, 5],
                       [2008, 10, 31, 5],
                       [2008, 11, 30, 6],
                       [2008, 12, 31, 5],
                       [2009,  1, 31, 5],
                       [2009,  2, 28, 4],
                       [2009,  3, 31, 5]];
   let box = "";
-  
+
   // check all dates
   for(let i = 0; i < checkingData.length; i++){
     calUtils.goToDate(controller, checkingData[i][0], checkingData[i][1], checkingData[i][2]);
-    
+
     // day view
     calUtils.switchToView(controller, "day");
     box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath;
     controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
-    
+
     // week view
     calUtils.switchToView(controller, "week");
     let date = new Date(checkingData[i][0], checkingData[i][1] - 1, checkingData[i][2]);
     let column = date.getDay() + 1;
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, column, hour)
       + eventPath;
     controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
-    
+
     // multiweek view
     calUtils.switchToView(controller, "multiweek");
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, 1, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // month view
     calUtils.switchToView(controller, "month");
     box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, checkingData[i][3],
       column, undefined) + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // delete event
   calUtils.goToDate(controller, checkingData[0][0], checkingData[0][1], checkingData[0][2]);
   calUtils.switchToView(controller, "day");
   box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX,
     undefined, 1, hour) + eventPath;
   calUtils.handleParentDeletion(controller, false);
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, box));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 }
 
 function setRecurrence(recurrence){
   recurrence.sleep(sleep);
-  
+
   // monthly
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined,
     undefined, "2");
-  
+
   // last day of month
   recurrence.click(new elementslib.ID(recurrence.window.document, "montly-period-relative-date-radio"));
   recurrence.sleep(sleep);
   recurrence.select(new elementslib.ID(recurrence.window.document, "monthly-ordinal"), undefined,
     undefined, "-1");
   recurrence.sleep(sleep);
   recurrence.select(new elementslib.ID(recurrence.window.document, "monthly-weekday"), undefined,
     undefined, "-1");
   recurrence.sleep(sleep);
-  
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document,
     '/id("calendar-event-dialog-recurrence")/anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
 }
--- a/calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
@@ -15,129 +15,128 @@ var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testWeeklyNRecurrence = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5);
-  
+
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
-  
+
   // check day view
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   // Monday, Tuesday, Wednesday, Thursday
   for(let i = 0; i < 4; i++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 1);
   }
-  
+
   // Saturday
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
-  
+
   // check week view
   calUtils.switchToView(controller, "week");
-  
+
   // Monday, Tuesday, Wednesday, Thursday
   for(let i = 2; i < 6; i++){
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, i, hour)
       + eventPath;
     controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // Saturday
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
-  
+
   // check multiweek view
   calUtils.switchToView(controller, "multiweek");
   checkMultiWeekView("multiweek");
-  
+
   // check month view
   calUtils.switchToView(controller, "month");
   checkMultiWeekView("month");
-  
+
   // delete event
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 2, hour)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, box));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 }
 
 function setRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let tue = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.3.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let thu = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.5.Mmm");
   let sat = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.7.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // starting from Monday so it should be checked
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   // check Tuesday, Wednesday, Thursday and Saturday too
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + tue + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + thu + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + sat + '"}'));
-  
+
   // set number of occurrences
   recurrence.click(new elementslib.ID(recurrence.window.document, "recurrence-range-for"));
   let input = '/id("calendar-event-dialog-recurrence")/id("recurrence-range-groupbox")/[1]/'
     + 'id("recurrence-duration")/id("recurrence-range-count-box")/id("repeat-ntimes-count")/'
     + 'anon({"class":"textbox-input-box numberbox-input-box"})/anon({"anonid":"input"})';
   // replace previous number
   recurrence.keypress(new elementslib.Lookup(recurrence.window.document, input), "a", {ctrlKey:true});
   recurrence.type(new elementslib.Lookup(recurrence.window.document, input), "4");
-    
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkMultiWeekView(view){
   let week = 1;
-  
+
   // in month view event starts from 2nd row
   if(view == "month") week++;
 
   // Monday, Tuesday, Wednesday, Thursday
   for(let i = 2; i < 6; i++){
     let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, i, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // Saturday
   let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 7, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
--- a/calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
@@ -1,12 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("../shared-modules/calendar-utils");
 var modalDialog = require("../shared-modules/modal-dialog");
 var utils = require("../shared-modules/utils");
 
 var sleep = 500;
 var calendar = "Mozmill";
 var endDate = new Date(2009, 0, 26); // last Monday in month
 
@@ -17,147 +17,147 @@ var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testWeeklyUntilRecurrence = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5); // Monday
-  
+
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   // check day view
   for(let week = 0; week < 3; week++){
     // Monday
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 2);
     // Wednesday
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 2);
     // Friday
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 3);
   }
-  
+
   // Monday, last occurrence
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 2);
   // Wednesday
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 2);
-  
+
   // check week view
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 5);
   for(let week = 0; week < 3; week++){
     // Monday
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     // Wednesday
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     // Friday
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 6, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     calUtils.forward(controller, 1);
   }
-  
+
   // Monday, last occurrence
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   // Wednesday
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
-  
+
   // check multiweek view
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 5);
   checkMultiWeekView("multiweek");
-  
+
   // check month view
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 5);
   checkMultiWeekView("month");
-  
+
   // delete event
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 2, undefined)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, box));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 }
 
 function setRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let fri = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.6.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // starting from Monday so it should be checked
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   // check Wednesday and Friday too
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + fri + '"}'));
-  
+
   // set until date
   recurrence.click(new elementslib.ID(recurrence.window.document, "recurrence-range-until"));
   let input = '/id("calendar-event-dialog-recurrence")/id("recurrence-range-groupbox")/[1]/'
     + 'id("recurrence-duration")/id("recurrence-range-until-box")/id("repeat-until-date")/'
     + 'anon({"class":"datepicker-box-class"})/{"class":"datepicker-text-class"}/'
     + 'anon({"class":"menulist-editable-box textbox-input-box"})/anon({"anonid":"input"})';
   // delete previous date
   recurrence.keypress(new elementslib.Lookup(recurrence.window.document, input), "a", {ctrlKey:true});
   recurrence.keypress(new elementslib.Lookup(recurrence.window.document, input), "VK_DELETE", {});
 
   let dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                      .getService(Components.interfaces.nsIScriptableDateFormat);
-  let endDateString = dateService.FormatDate("", dateService.dateFormatShort, 
+  let endDateString = dateService.FormatDate("", dateService.dateFormatShort,
                                              endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate());
   recurrence.type(new elementslib.Lookup(recurrence.window.document, input), endDateString);
-  
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkMultiWeekView(view){
   let startWeek = 1;
-  
+
   // in month view event starts from 2nd row
   if(view == "month") startWeek++;
 
   for(let week = startWeek; week < startWeek + 3; week++){
     // Monday
     let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 2, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
@@ -165,17 +165,17 @@ function checkMultiWeekView(view){
     box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 4, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     // Friday
     box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 6, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // Monday, last occurrence
   let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 3, 2,
     undefined) + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   // Wednesday
   box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 3, 4,
     undefined) + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
--- a/calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
@@ -16,185 +16,185 @@ var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testWeeklyWithExceptionRecurrence = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5);
-  
+
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // move 5th January occurrence to 6th January
   calUtils.handleOccurrenceModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
   event.sleep(sleep);
-  
+
   let startDateInput = new elementslib.Lookup(event.window.document, '/id("calendar-event-dialog")/'
     + 'id("event-grid")/id("event-grid-rows")/id("event-grid-startdate-row")/'
     + 'id("event-grid-startdate-picker-box")/id("event-starttime")/anon({"anonid":"hbox"})/'
     + 'anon({"anonid":"date-picker"})/anon({"class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   let endDateInput = new elementslib.Lookup(event.window.document, '/id("calendar-event-dialog")/'
     + 'id("event-grid")/id("event-grid-rows")/id("event-grid-enddate-row")/[1]/'
     + 'id("event-grid-enddate-picker-box")/id("event-endtime")/anon({"anonid":"hbox"})/'
     + 'anon({"anonid":"date-picker"})/anon({"class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
 
   event.keypress(startDateInput, "a", {ctrlKey:true});
   let dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                      .getService(Components.interfaces.nsIScriptableDateFormat);
-  let startDateString = dateService.FormatDate("", dateService.dateFormatShort, 
+  let startDateString = dateService.FormatDate("", dateService.dateFormatShort,
                                              startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate());
   event.type(startDateInput, startDateString);
   // applies startdate change
   event.click(endDateInput);
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // change recurrence rule
   calUtils.goToDate(controller, 2009, 1, 7);
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   md = new modalDialog.modalDialog(event.window);
   md.start(changeRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // check two weeks
   // day view
   calUtils.switchToView(controller, "day");
   let path = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   calUtils.goToDate(controller, 2009, 1, 5);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   calUtils.forward(controller, 1);
   let tuesPath = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/id("calendarDisplayDeck")/id("calendar-view-box")/'
     + 'id("view-deck")/id("day-view")/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/'
     + 'anon({"anonid":"daybox"})/[0]/anon({"anonid":"boxstack"})/anon({"anonid":"topbox"})/'
     + '{"flex":"1"}/{"flex":"1"}/[eventIndex]';
   // assert exactly two
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("eventIndex", "0") + eventPath));
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("eventIndex", "1") + eventPath));
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("eventIndex", "2") + eventPath));
-  
+
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   // next week
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   // week view
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 5);
-  
+
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   tuesPath = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/id("calendarDisplayDeck")/id("calendar-view-box")/'
     + 'id("view-deck")/id("week-view")/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/'
     + 'anon({"anonid":"daybox"})/[dayIndex]/anon({"anonid":"boxstack"})/anon({"anonid":"topbox"})/'
     + '{"flex":"1"}/{"flex":"1"}/[eventIndex]';
   // assert exactly two
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("dayIndex", "2").replace("eventIndex", "0") + eventPath));
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("dayIndex", "2").replace("eventIndex", "1") + eventPath));
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("dayIndex", "2").replace("eventIndex", "2") + eventPath));
-  
+
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 5, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 6, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   calUtils.forward(controller, 1);
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 1, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 3, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 5, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 6, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   // multiweek view
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 5);
   checkMultiWeekView("multiweek");
-  
+
   // month view
   calUtils.switchToView(controller, "month");
   checkMultiWeekView("month");
-  
+
   // delete event
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 12);
   path = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, path));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
@@ -202,59 +202,59 @@ var testWeeklyWithExceptionRecurrence = 
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, path));
 }
 
 function setRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let fri = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.6.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // starting from Monday so it should be checked
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   // check Wednesday and Friday too
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + fri + '"}'));
-    
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function changeRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let tue = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.3.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let fri = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.6.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // check old rule
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + fri + '"}'));
-  
+
   // check Tuesday
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + tue + '"}'));
-  
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkMultiWeekView(view){
   let startWeek = view == "multiweek" ? 1 : 2
 
@@ -270,17 +270,17 @@ function checkMultiWeekView(view){
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 5, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 6, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 7, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path + eventPath));
-  
+
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 1, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 2, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 3, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
--- a/calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
@@ -11,82 +11,82 @@ var epoch = 1970;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testAnnualRecurrence = function () {
   var eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, startYear, 1, 1);
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create yearly recurring all-day event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
                  .getWindows("Calendar:EventDialog")[0]);
   event.sleep(sleep);
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "yearly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.sleep(sleep);
-  
+
   let checkYears = [startYear, startYear + 1, epoch - 1, epoch, epoch + 1];
   let box = "";
   for(let i = 0; i < checkYears.length; i++){
     calUtils.goToDate(controller, checkYears[i], 1, 1);
     let date = new Date(checkYears[i], 0, 1);
     let column = date.getDay() + 1;
-    
+
     // day view
     calUtils.switchToView(controller, "day");
     box = calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // week view
     calUtils.switchToView(controller, "week");
     box = calUtils.getEventBoxPath(controller, "week", calUtils.ALLDAY, undefined, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // multiweek view
     calUtils.switchToView(controller, "multiweek");
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.ALLDAY, 1, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // month view
     calUtils.switchToView(controller, "month");
     box = calUtils.getEventBoxPath(controller, "month", calUtils.ALLDAY, 1, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // delete event
   calUtils.goToDate(controller, checkYears[0], 1, 1);
   calUtils.switchToView(controller, "day");
   box = calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)
     + eventPath;
   calUtils.handleParentDeletion(controller, false);
   controller.click(new elementslib.Lookup(controller.window.document, box));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
-  
+
   // reset view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
 var teardownTest = function(module) {
--- a/calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
@@ -1,116 +1,116 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("../shared-modules/calendar-utils");
 
 var sleep = 500;
 var calendar = "Mozmill";
 var hour = 8;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testBiweeklyRecurrence = function () {
   var eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 31);
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create biweekly event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "bi.weekly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   // check day view
   for(let i = 0; i < 4; i++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 14);
   }
-  
+
   // check week view
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 31);
-  
+
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour)
     + eventPath;
   for(let i = 0; i < 4; i++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(2);
   }
 
   // check multiweek view
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 31);
-  
+
   // always two occurrences in view, 1st and 3rd or 2nd and 4th week
   for(let i = 0; i < 5; i++){
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i % 2 + 1, 7,
       undefined) + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i % 2 + 3, 7,
       undefined) + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 1);
   }
-  
+
   // check month view
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 31);
 
   // January
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 5, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 1);
-  
+
   // February
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 4, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 1);
-  
+
   // March
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 7, undefined)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 4, 7, undefined)
     + eventPath;
-  controller.assertNode(new elementslib.Lookup(controller.window.document, box));  
+  controller.assertNode(new elementslib.Lookup(controller.window.document, box));
 
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document, box));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
-  
+
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
--- a/calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
@@ -10,206 +10,206 @@ var hour = 8;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testDailyRecurrence = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create daily event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "daily");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // check day view for 7 days
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour, undefined)
     + eventPath;
   controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
-  
+
   for(let day = 1; day <= 7; day++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 1);
   }
-  
+
   // check week view for 2 weeks
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let day = 5; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, 1, day, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   calUtils.forward(controller, 1);
-  
+
   for(let day = 1; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, 2, day, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // check multiweek view for 4 weeks
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let day = 5; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, 1, day, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   for(let week = 2; week <= 4; week++){
     for(let day = 1; day <= 7; day++){
       let box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, week, day, hour)
         + eventPath;
       controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     }
   }
-  
+
   // check month view for all 5 weeks
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let day = 5; day <= 7; day++){
     let box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 1, day, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   for(let week = 2; week <= 5; week++){
     for(let day = 1; day <= 7; day++){
       let box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, week, day, undefined)
         + eventPath;
       controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     }
   }
-  
+
   // delete 3rd January occurrence
   let saturday = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 1, 7, undefined)
     + eventPath;
   calUtils.handleOccurrenceDeletion(controller, false);
   controller.click(new elementslib.Lookup(controller.window.document, saturday));
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
-  
+
   // verify in all views
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, saturday));
-  
+
   calUtils.switchToView(controller, "multiweek");
   saturday = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, 1, 7, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, saturday));
-    
+
   calUtils.switchToView(controller, "week");
   saturday = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, saturday));
-    
+
   calUtils.switchToView(controller, "day");
   saturday = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, saturday));
-  
+
   // go to previous day to edit event to occur only on weekdays
   calUtils.back(controller, 1);
-  
+
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath));
-  
+
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "every.weekday");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // check day view for 7 days
   let day = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, undefined)
     + eventPath;
   var dates = [[2009, 1, 3],
                [2009, 1, 4]];
   for(let i = 0; i < dates.length; i++){
     calUtils.goToDate(controller, dates[i][0], dates[i][1], dates[i][2]);
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
   }
-  
+
   // check week view for 2 weeks
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let i = 0; i <= 1; i++){
     let day = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 1, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     day = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     calUtils.forward(controller, 1);
   }
-  
+
   // check multiweek view for 4 weeks
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let i = 1; i <= 4; i++){
     let day = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i, 1, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     day = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, i, 7, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
   }
-  
+
   // check month view for all 5 weeks
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   for(let i = 1; i <= 5; i++){
     let day = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, i, 1, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
     day = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, i, 7, undefined)
       + eventPath;
     controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, day));
   }
-  
+
   // delete event
   day = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 1, 5, undefined)
     + eventPath
   controller.click(new elementslib.Lookup(controller.window.document, day));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, day));
-  
+
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
--- a/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
@@ -1,12 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("../shared-modules/calendar-utils");
 var modalDialog = require("../shared-modules/modal-dialog");
 
 var sleep = 500;
 var calendar = "Mozmill";
 var hour = 8;
 
 var setupModule = function(module) {
@@ -14,39 +14,39 @@ var setupModule = function(module) {
   calUtils.createCalendar(controller, calendar);
 }
 
 var testLastDayOfMonthRecurrence = function () {
   var eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2008, 1, 31); // start with a leap year
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create monthly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   //                        date     correct row in month view
   let checkingData = [[2008,  1, 31, 5],
                       [2008,  2, 29, 5],
                       [2008,  3, 31, 6],
                       [2008,  4, 30, 5],
                       [2008,  5, 31, 5],
                       [2008,  6, 30, 5],
                       [2008,  7, 31, 5],
@@ -54,83 +54,83 @@ var testLastDayOfMonthRecurrence = funct
                       [2008,  9, 30, 5],
                       [2008, 10, 31, 5],
                       [2008, 11, 30, 6],
                       [2008, 12, 31, 5],
                       [2009,  1, 31, 5],
                       [2009,  2, 28, 4],
                       [2009,  3, 31, 5]];
   let box = "";
-  
+
   // check all dates
   for(let i = 0; i < checkingData.length; i++){
     calUtils.goToDate(controller, checkingData[i][0], checkingData[i][1], checkingData[i][2]);
-    
+
     // day view
     calUtils.switchToView(controller, "day");
     box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath;
     controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
-    
+
     // week view
     calUtils.switchToView(controller, "week");
     let date = new Date(checkingData[i][0], checkingData[i][1] - 1, checkingData[i][2]);
     let column = date.getDay() + 1;
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, column, hour)
       + eventPath;
     controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
-    
+
     // multiweek view
     calUtils.switchToView(controller, "multiweek");
     box = calUtils.getEventBoxPath(controller, "multiweek", calUtils.EVENT_BOX, 1, column, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     // month view
     calUtils.switchToView(controller, "month");
     box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, checkingData[i][3],
       column, undefined) + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // delete event
   calUtils.goToDate(controller, checkingData[0][0], checkingData[0][1], checkingData[0][2]);
   calUtils.switchToView(controller, "day");
   box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX,
     undefined, 1, hour) + eventPath;
   calUtils.handleParentDeletion(controller, false);
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, box));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
-  
+
   // reset view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
 function setRecurrence(recurrence){
   recurrence.sleep(sleep);
-  
+
   // monthly
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined,
     undefined, "2");
-  
+
   // last day of month
   recurrence.click(new elementslib.ID(recurrence.window.document, "montly-period-relative-date-radio"));
   recurrence.sleep(sleep);
   recurrence.select(new elementslib.ID(recurrence.window.document, "monthly-ordinal"), undefined,
     undefined, "-1");
   recurrence.sleep(sleep);
   recurrence.select(new elementslib.ID(recurrence.window.document, "monthly-weekday"), undefined,
     undefined, "-1");
   recurrence.sleep(sleep);
-  
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document,
     '/id("calendar-event-dialog-recurrence")/anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
 }
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
@@ -15,142 +15,141 @@ var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testWeeklyNRecurrence = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5);
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
-  
+
   // check day view
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   // Monday, Tuesday, Wednesday, Thursday
   for(let i = 0; i < 4; i++){
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 1);
   }
-  
+
   // Saturday
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
-  
+
   // check week view
   calUtils.switchToView(controller, "week");
-  
+
   // Monday, Tuesday, Wednesday, Thursday
   for(let i = 2; i < 6; i++){
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, i, hour)
       + eventPath;
     controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // Saturday
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
-  
+
   // check multiweek view
   calUtils.switchToView(controller, "multiweek");
   checkMultiWeekView("multiweek");
-  
+
   // check month view
   calUtils.switchToView(controller, "month");
   checkMultiWeekView("month");
-  
+
   // delete event
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 2, hour)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, box));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
-  
+
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
 function setRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let tue = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.3.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let thu = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.5.Mmm");
   let sat = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.7.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // starting from Monday so it should be checked
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   // check Tuesday, Wednesday, Thursday and Saturday too
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + tue + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + thu + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + sat + '"}'));
-  
+
   // set number of occurrences
   recurrence.click(new elementslib.ID(recurrence.window.document, "recurrence-range-for"));
   let input = '/id("calendar-event-dialog-recurrence")/id("recurrence-range-groupbox")/[1]/'
     + 'id("recurrence-duration")/id("recurrence-range-count-box")/id("repeat-ntimes-count")/'
     + 'anon({"class":"textbox-input-box numberbox-input-box"})/anon({"anonid":"input"})';
   // replace previous number
   recurrence.keypress(new elementslib.Lookup(recurrence.window.document, input), "a", {ctrlKey:true});
   recurrence.type(new elementslib.Lookup(recurrence.window.document, input), "4");
-    
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkMultiWeekView(view){
   let week = 1;
-  
+
   // in month view event starts from 2nd row
   if(view == "month") week++;
 
   // Monday, Tuesday, Wednesday, Thursday
   for(let i = 2; i < 6; i++){
     let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, i, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // Saturday
   let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 7, undefined)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
@@ -1,12 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("../shared-modules/calendar-utils");
 var modalDialog = require("../shared-modules/modal-dialog");
 var utils = require("../shared-modules/utils");
 
 var sleep = 500;
 var calendar = "Mozmill";
 var endDate = new Date(2009, 0, 26); // last Monday in month
 var hour = 8;
@@ -16,161 +16,161 @@ var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testWeeklyUntilRecurrence = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5); // Monday
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   // check day view
   for(let week = 0; week < 3; week++){
     // Monday
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 2);
     // Wednesday
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 2);
     // Friday
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 3);
   }
-  
+
   // Monday, last occurrence
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 2);
   // Wednesday
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
   calUtils.forward(controller, 2);
-  
+
   // check week view
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 5);
   for(let week = 0; week < 3; week++){
     // Monday
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     // Wednesday
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     // Friday
     box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 6, hour)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
-    
+
     calUtils.forward(controller, 1);
   }
-  
+
   // Monday, last occurrence
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour)
     + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   // Wednesday
   box = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
-  
+
   // check multiweek view
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 5);
   checkMultiWeekView("multiweek");
-  
+
   // check month view
   calUtils.switchToView(controller, "month");
   calUtils.goToDate(controller, 2009, 1, 5);
   checkMultiWeekView("month");
-  
+
   // delete event
   box = calUtils.getEventBoxPath(controller, "month", calUtils.EVENT_BOX, 2, 2, undefined)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, box));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
-  
+
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
 function setRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let fri = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.6.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // starting from Monday so it should be checked
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   // check Wednesday and Friday too
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + fri + '"}'));
-  
+
   // set until date
   recurrence.click(new elementslib.ID(recurrence.window.document, "recurrence-range-until"));
   let input = '/id("calendar-event-dialog-recurrence")/id("recurrence-range-groupbox")/[1]/'
     + 'id("recurrence-duration")/id("recurrence-range-until-box")/id("repeat-until-date")/'
     + 'anon({"class":"datepicker-box-class"})/{"class":"datepicker-text-class"}/'
     + 'anon({"class":"menulist-editable-box textbox-input-box"})/anon({"anonid":"input"})';
   // delete previous date
   recurrence.keypress(new elementslib.Lookup(recurrence.window.document, input), "a", {ctrlKey:true});
   recurrence.keypress(new elementslib.Lookup(recurrence.window.document, input), "VK_DELETE", {});
-  
+
   let dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                      .getService(Components.interfaces.nsIScriptableDateFormat);
-  let endDateString = dateService.FormatDate("", dateService.dateFormatShort, 
+  let endDateString = dateService.FormatDate("", dateService.dateFormatShort,
                                              endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate());
-  
+
   recurrence.type(new elementslib.Lookup(recurrence.window.document, input), endDateString);
-  
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkMultiWeekView(view){
   let startWeek = 1;
-  
+
   // in month view event starts from 2nd row
   if(view == "month") startWeek++;
 
   for(let week = startWeek; week < startWeek + 3; week++){
     // Monday
     let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 2, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
@@ -178,19 +178,19 @@ function checkMultiWeekView(view){
     box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 4, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     // Friday
     box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, week, 6, undefined)
       + eventPath;
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   }
-  
+
   // Monday, last occurrence
-  let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 3, 2, 
+  let box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 3, 2,
     undefined) + eventPath;
   controller.assertNode(new elementslib.Lookup(controller.window.document, box));
   // Wednesday
   box = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 3, 4,
     undefined) + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, box));
 }
 
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
@@ -16,256 +16,256 @@ var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   calUtils.createCalendar(controller, calendar);
 }
 
 var testWeeklyWithExceptionRecurrence = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5);
-  
+
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal"});
-  
+
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // move 5th January occurrence to 6th January
   calUtils.handleOccurrenceModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
   event.sleep(sleep);
-  
+
   let startDateInput = new elementslib.Lookup(event.window.document, '/id("calendar-event-dialog")/'
     + 'id("event-grid")/id("event-grid-rows")/id("event-grid-startdate-row")/'
     + 'id("event-grid-startdate-picker-box")/id("event-starttime")/anon({"anonid":"hbox"})/'
     + 'anon({"anonid":"date-picker"})/anon({"class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   let endDateInput = new elementslib.Lookup(event.window.document, '/id("calendar-event-dialog")/'
     + 'id("event-grid")/id("event-grid-rows")/id("event-grid-enddate-row")/[1]/'
     + 'id("event-grid-enddate-picker-box")/id("event-endtime")/anon({"anonid":"hbox"})/'
     + 'anon({"anonid":"date-picker"})/anon({"class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
 
   event.keypress(startDateInput, "a", {ctrlKey:true});
   let dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                      .getService(Components.interfaces.nsIScriptableDateFormat);
-  let startDateString = dateService.FormatDate("", dateService.dateFormatShort, 
+  let startDateString = dateService.FormatDate("", dateService.dateFormatShort,
                                              startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate());
   event.type(startDateInput, startDateString);
   // applies startdate change
   event.click(endDateInput);
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // change recurrence rule
   calUtils.goToDate(controller, 2009, 1, 7);
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
       + eventPath));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   md = new modalDialog.modalDialog(event.window);
   md.start(changeRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
-  
+
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // check two weeks
   // day view
   calUtils.switchToView(controller, "day");
   let path = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
-  
+
   calUtils.goToDate(controller, 2009, 1, 5);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   calUtils.forward(controller, 1);
   let tuesPath = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/id("calendarDisplayDeck")/id("calendar-view-box")/'
     + 'id("view-deck")/id("day-view")/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/'
     + 'anon({"anonid":"daybox"})/[0]/anon({"anonid":"boxstack"})/anon({"anonid":"topbox"})/'
     + '{"flex":"1"}/{"flex":"1"}/[eventIndex]';
   // assert exactly two
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("eventIndex", "0") + eventPath));
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("eventIndex", "1") + eventPath));
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("eventIndex", "2") + eventPath));
-  
+
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   // next week
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   calUtils.forward(controller, 1);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   // week view
   calUtils.switchToView(controller, "week");
   calUtils.goToDate(controller, 2009, 1, 5);
-  
+
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour)
     + eventPath;
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   tuesPath = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/id("calendarDisplayDeck")/id("calendar-view-box")/'
     + 'id("view-deck")/id("week-view")/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/'
     + 'anon({"anonid":"daybox"})/[dayIndex]/anon({"anonid":"boxstack"})/anon({"anonid":"topbox"})/'
     + '{"flex":"1"}/{"flex":"1"}/[eventIndex]';
   // assert exactly two
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("dayIndex", "2").replace("eventIndex", "0") + eventPath));
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("dayIndex", "2").replace("eventIndex", "1") + eventPath));
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document,
     tuesPath.replace("dayIndex", "2").replace("eventIndex", "2") + eventPath));
-  
+
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 5, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 6, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   calUtils.forward(controller, 1);
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 1, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 2, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 3, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 5, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 6, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path));
   path = calUtils.getEventBoxPath(controller, "week", calUtils.EVENT_BOX, undefined, 7, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path));
-  
+
   // multiweek view
   calUtils.switchToView(controller, "multiweek");
   calUtils.goToDate(controller, 2009, 1, 5);
   checkMultiWeekView("multiweek");
-  
+
   // month view
   calUtils.switchToView(controller, "month");
   checkMultiWeekView("month");
-  
+
   // delete event
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 12);
   path = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + eventPath;
   controller.click(new elementslib.Lookup(controller.window.document, path));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, path));
-  
+
   // reset view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(function() {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical"});
 }
 
 function setRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let fri = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.6.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // starting from Monday so it should be checked
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   // check Wednesday and Friday too
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + fri + '"}'));
-    
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function changeRecurrence(recurrence){
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
   recurrence.select(new elementslib.ID(recurrence.window.document, "period-list"), undefined, undefined, "1");
   recurrence.sleep(sleep);
-  
+
   let mon = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.2.Mmm");
   let tue = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.3.Mmm");
   let wed = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.4.Mmm");
   let fri = utils.getProperty("chrome://calendar/locale/dateFormat.properties", "day.6.Mmm");
-  
+
   let days = '/id("calendar-event-dialog-recurrence")/id("recurrence-pattern-groupbox")/'
     + 'id("recurrence-pattern-grid")/id("recurrence-pattern-rows")/id("recurrence-pattern-period-row")/'
     + 'id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")/anon({"anonid":"mainbox"})/';
-  
+
   // check old rule
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + mon + '"}'));
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + wed + '"}'));
   recurrence.assertChecked(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + fri + '"}'));
-  
+
   // check Tuesday
   recurrence.click(new elementslib.Lookup(recurrence.window.document, days + '{"label":"' + tue + '"}'));
-  
+
   // close dialog
   recurrence.click(new elementslib.Lookup(recurrence.window.document, '/id("calendar-event-dialog-recurrence")/'
     + 'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
 }
 
 function checkMultiWeekView(view){
   let startWeek = view == "multiweek" ? 1 : 2
 
@@ -281,17 +281,17 @@ function checkMultiWeekView(view){
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 5, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 6, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek, 7, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path + eventPath));
-  
+
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 1, hour);
   controller.assertNodeNotExist(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 2, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 3, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
   path = calUtils.getEventBoxPath(controller, view, calUtils.EVENT_BOX, startWeek + 1, 4, hour);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path + eventPath));
--- a/calendar/test/mozmill/shared-modules/calendar-utils.js
+++ b/calendar/test/mozmill/shared-modules/calendar-utils.js
@@ -154,59 +154,59 @@ function goToDate(controller, year, mont
   let activeYear = (new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"years-popup"})/[0]/{"current":"true"}')).getNode().getAttribute("value");
   let activeMonth = (new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"months-popup"})/[0]/{"current":"true"}')).getNode().getAttribute("index");
   let yearDifference = activeYear - year;
   let monthDifference = activeMonth - (month - 1);
-  
+
   if (yearDifference != 0) {
     let scrollArrow = yearDifference > 0 ?
       (new elementslib.Lookup(controller.window.document, miniMonth
         + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
         + 'anon({"anonid":"years-popup"})/[0]/{"class":"autorepeatbutton-up"}')).getNode() :
       (new elementslib.Lookup(controller.window.document, miniMonth
         + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
         + 'anon({"anonid":"years-popup"})/[0]/{"class":"autorepeatbutton-down"}')).getNode();
-    
+
     // pick year
     controller.click(new elementslib.Lookup(controller.window.document, miniMonth
       + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"yearcell"})'));
     controller.sleep(500);
-    
+
     for(let i = 0; i < Math.abs(yearDifference); i++){
       scrollArrow.doCommand();
       controller.sleep(100);
     }
-  
+
     controller.click(new elementslib.Lookup(controller.window.document, miniMonth
       + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
       + 'anon({"anonid":"years-popup"})/[0]/{"value":"' + year + '"}'));
     controller.sleep(500);
   }
-  
+
   if (monthDifference != 0) {
     // pick month
     controller.click(new elementslib.Lookup(controller.window.document, miniMonth
       + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"monthheader"})/[' + activeMonth
       + ']'));
     controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
       + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
       + 'anon({"anonid":"months-popup"})/[0]/{"index":"' + (month - 1) + '"}'));
     controller.sleep(500);
   }
-  
+
   let lastDayInFirstRow = (new elementslib.Lookup(controller.window.document,
     miniMonth + 'anon({"anonid":"minimonth-calendar"})/[1]/[6]')).getNode().getAttribute("value");
   let positionOfFirst = 7 - lastDayInFirstRow;
   let dateColumn = (positionOfFirst + day - 1) % 7;
   let dateRow = Math.floor((positionOfFirst + day - 1) / 7);
-  
+
   // pick day
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-calendar"})/[' + (dateRow + 1) + ']/[' + dateColumn + ']'));
   controller.sleep(500);
 }
 
 /**
  *  @param controller - main window controller
@@ -220,56 +220,56 @@ function goToDate(controller, year, mont
 function getEventBoxPath(controller, view, option, row, column, hour){
   let viewDeck = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/'
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")';
   let dayView = viewDeck + '/id("day-view")';
   let weekView = viewDeck + '/id("week-view")';
   let multiweekView = viewDeck + '/id("multiweek-view")';
   let monthView = viewDeck + '/id("month-view")';
-  
+
   let path = '';
   switch(view){
     case "week":
       path += weekView;
       break;
     case "multiweek":
       path += multiweekView;
       break;
     case "month":
       path += monthView;
       break;
     default: path += dayView;
   }
-  
+
   if((view == "day" || view == "week") && option == ALLDAY){
     path += '/anon({"anonid":"mainbox"})/anon({"anonid":"headerbox"})/anon({"anonid":"headerdaybox"})';
     path += '/[' + (column - 1) + ']';
-    
+
     return path;
   }
   else if(view == "day" || view == "week"){
     path += '/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})';
     path += '/[' + (column - 1) + ']';
     path += '/anon({"anonid":"boxstack"})';
-    
+
     if(option == CANVAS_BOX)
       path += '/anon({"anonid":"bgbox"})/[' + hour + ']';
     else
       path += '/anon({"anonid":"topbox"})/{"flex":"1"}/{"flex":"1"}/{"flex":"1"}';
-    
+
     return path;
   }
   else{
     path += '/anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/'
       + 'anon({"anonid":"monthgridrows"})/[' + (row - 1) + ']/[' + (column - 1) + ']';
-  
+
     if(option == CANVAS_BOX)
       path += '/anon({"anonid":"day-items"})';
-    
+
     return path;
   }
 }
 
 /**
  * @param controller - Mozmill window controller
  * @param n - how many times next button in view is clicked
  */
@@ -317,17 +317,17 @@ function createCalendar(controller, name
   let defaultView = (new elementslib.ID(controller.window.document, "messengerWindow"))
                     .getNode().ownerDocument.defaultView;
   let manager = defaultView.getCalendarManager();
 
   let url = defaultView.makeURL("moz-storage-calendar://");
   let calendar = manager.createCalendar("storage", url);
   calendar.name = name;
   manager.registerCalendar(calendar);
-  
+
   let id = calendar.id;
   let calendarTree = (new elementslib.Lookup(controller.window.document,
     '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/id("ltnSidebar")/id("calendar-panel")/'
     + 'id("calendar-list-pane")/id("calendar-listtree-pane")/id("calendar-list-tree-widget")'))
     .getNode();
   for(i = 0; i < calendarTree.mCalendarList.length; i++)
     if(calendarTree.mCalendarList[i].id == id)
@@ -378,17 +378,17 @@ function findEventsInNode(node, eventNod
  *                  attachment.add - url to add
  *                  attachment.remove - label of url to remove (without http://)
  */
 function setData(controller, data) {
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
   let taskDialog = '/id("calendar-task-dialog")/id("event-grid")/id("event-grid-rows")/';
   let dialog;
   let isEvent = true;
-  
+
   // see if it's an event dialog
   try {
     (new elementslib.Lookup(controller.window.document, eventDialog)).getNode();
     dialog = eventDialog;
   } catch (error) {
     dialog = taskDialog;
     isEvent = false;
   }
@@ -421,135 +421,135 @@ function setData(controller, data) {
     + 'id("event-grid-todo-status-row")/id("event-grid-todo-status-picker-box")/'
     + 'id("percent-complete-textbox")/anon({"class":"textbox-input-box numberbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   let dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                               .getService(Components.interfaces.nsIScriptableDateFormat);
   let mac = utils.appInfo.os.toLowerCase().includes("darwin");
   // wait for input elements' values to be populated
   controller.sleep(sleep);
-  
+
   // title
   if (data.title != undefined) {
     if (!mac) {
       controller.keypress(new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
         + 'anon({"anonid":"input"})'),
         'a', {ctrlKey: true});
       controller.type(new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
         + 'anon({"anonid":"input"})'),
         data.title);
     } else {
       let titleField = new elementslib.ID(controller.window.document, "item-title");
       titleField.getNode().value = data.title;
     }
   }
-  
+
   // location
   if (data.location != undefined) {
     if (!mac) {
       controller.keypress(new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-location-row")/id("item-location")/anon({"class":"textbox-input-box"})/'
         + 'anon({"anonid":"input"})'),
         'a', {ctrlKey: true});
       controller.type(new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-location-row")/id("item-location")/anon({"class":"textbox-input-box"})/'
         + 'anon({"anonid":"input"})'),
         data.location);
     } else {
       let locationField = new elementslib.ID(controller.window.document, "item-location");
       locationField.getNode().value = data.location;
     }
   }
-  
+
   // category
   if (data.category != undefined) {
     controller.select(new elementslib.ID(controller.window.document, "item-categories"), undefined,
       data.category);
     controller.sleep(sleep);
   }
-  
+
   // all-day
   if (data.allday != undefined && isEvent) {
     controller.check(new elementslib.ID(controller.window.document, "event-all-day"), data.allday);
   }
-  
+
   // timezone
   if (data.timezone != undefined) {
     let menuitem = new elementslib.ID(controller.window.document, "options-timezones-menuitem");
     menuitem.getNode().setAttribute("checked", data.timezone);
     controller.click(menuitem);
   }
-  
+
   // startdate
   if (data.startdate != undefined && data.startdate.constructor.name == 'Date') {
     let startdate = dateService.FormatDate("", dateService.dateFormatShort,
       data.startdate.getFullYear(), data.startdate.getMonth() + 1, data.startdate.getDate());
     if(!isEvent)
       controller.check(new elementslib.ID(controller.window.document, "todo-has-entrydate"), true);
     if (!mac) {
       controller.keypress(startDateInput, 'a', {ctrlKey: true});
       controller.type(startDateInput, startdate);
     } else {
       startDateInput.getNode().value = startdate;
     }
   }
-  
+
   // starttime
   if (data.starttime != undefined && data.starttime.constructor.name == 'Date') {
     let starttime = dateService.FormatTime("", dateService.timeFormatNoSeconds,
       data.starttime.getHours(), data.starttime.getMinutes(), 0);
     if (!mac) {
       controller.keypress(startTimeInput, 'a', {ctrlKey: true});
       controller.type(startTimeInput, starttime);
     } else {
       startTimeInput.getNode().value = starttime;
       controller.sleep(sleep);
     }
   }
-  
+
   // enddate
   if (data.enddate != undefined && data.enddate.constructor.name == 'Date') {
     let enddate = dateService.FormatDate("", dateService.dateFormatShort,
       data.enddate.getFullYear(), data.enddate.getMonth() + 1, data.enddate.getDate());
     if(!isEvent)
       controller.check(new elementslib.ID(controller.window.document, "todo-has-duedate"), true);
     if (!mac) {
       controller.keypress(endDateInput, 'a', {ctrlKey: true});
       controller.type(endDateInput, enddate);
     } else {
       endDateInput.getNode().value = enddate;
     }
   }
-  
+
   // endttime
   if (data.endtime != undefined && data.endtime.constructor.name == 'Date') {
     let endtime = dateService.FormatTime("", dateService.timeFormatNoSeconds,
       data.endtime.getHours(), data.endtime.getMinutes(), 0);
     if (!mac) {
       controller.keypress(endTimeInput, 'a', {ctrlKey:true});
       controller.type(endTimeInput, endtime);
     } else {
       endTimeInput.getNode().value = endtime;
       controller.sleep(sleep);
     }
   }
-  
+
   // recurrence
   if (data.repeat != undefined) {
     controller.select(new elementslib.ID(controller.window.document, "item-repeat"), undefined,
       undefined, data.repeat);
   }
-  
+
   // reminder
   if (data.reminder != undefined) {
     controller.select(new elementslib.ID(controller.window.document, "item-alarm"), data.reminder);
   }
-  
+
   // description
   if (data.description != undefined) {
     if (!mac) {
       controller.keypress(new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-description-row")/id("item-description")/'
         + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
         'a', {ctrlKey: true});
       controller.type(new elementslib.Lookup(controller.window.document, dialog
@@ -558,83 +558,83 @@ function setData(controller, data) {
         data.description);
     } else {
       let descField = new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-description-row")/id("item-description")/'
         + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})');
       descField.getNode().value = data.description;
     }
   }
-  
+
   // priority
   if (data.priority != undefined) {
     controller.mainMenu.click("#options-priority-" + data.priority + "-label");
   }
-  
+
   // privacy
   if (data.privacy != undefined) {
     controller.mainMenu.click("#options-privacy-" + data.privacy + "-menuitem");
   }
-  
+
   // status
   if (data.status != undefined) {
     if (isEvent) {
       controller.mainMenu.click("#options-status-" + data.status + "-menuitem");
     } else {
       controller.select(new elementslib.ID(controller.window.document, "todo-status"), undefined,
         undefined, data.status.toUpperCase());
       controller.sleep(sleep);
     }
   }
-  
+
   let currentStatus = (new elementslib.ID(controller.window.document, "todo-status")).getNode().value;
-  
+
   // completed on
   if (data.completed != undefined && data.completed.constructor.name == 'Date' && !isEvent) {
     let completeddate = dateService.FormatDate("", dateService.dateFormatShort,
       data.completed.getFullYear(), data.completed.getMonth() + 1,
       data.completed.getDate());
-    
+
     if ( currentStatus == "COMPLETED") {
       if (!mac) {
         controller.keypress(completedDateInput, 'a', {ctrlKey: true});
         controller.type(completedDateInput, completeddate);
       } else {
         completedDateInput.getNode().value = completeddate;
       }
     }
   }
-  
+
   // percent complete
-  if (data.percent != undefined && 
+  if (data.percent != undefined &&
        (currentStatus == "NEEDS-ACTION" || currentStatus == "IN-PROCESS" ||
         currentStatus == "COMPLETED")) {
     percentCompleteInput.getNode().value = data.percent;
   }
-  
+
   // free/busy
   if (data.freebusy != undefined) {
     controller.mainMenu.click("#options-freebusy-" + data.freebusy + "-menuitem");
   }
-  
+
   // attachment
   if (data.attachment != undefined) {
     if (data.attachment.add != undefined) {
       handleAddingAttachment(controller, data.attachment.add);
       controller.click(new elementslib.ID(controller.window.document, "button-url"));
     }
     if (data.attachment.delete != undefined) {
       controller.click(new elementslib.Lookup(controller.window.document, dialog
         + 'id("event-grid-attachment-row")/id("attachment-link")/{"label":"' +
         data.attachment.delete + '"}'));
       controller.keypress(new elementslib.ID(controller.window.document, "attachment-link"),
         "VK_DELETE", {});
     }
   }
-  
+
   controller.sleep(sleep);
 }
 
 function open_lightning_prefs(aCallback, aParentController, collector, windowTimeout) {
   function paneLoadedChecker() {
     let pane = prefsController.window.document.getElementById("paneLightning");
     return pane.loaded;
   }
--- a/calendar/test/mozmill/shared-modules/timezone-utils.js
+++ b/calendar/test/mozmill/shared-modules/timezone-utils.js
@@ -1,12 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
 var calUtils = require("calendar-utils");
 var prefs = require("prefs");
 
 var sleep = 500;
 
 function switchAppTimezone(timezone) {
   // change directly as Mac has different Lookup & XPath than Windows & Linux, bug 536605
   prefs.preferences.setPref("calendar.timezone.local", timezone);
@@ -17,73 +17,73 @@ function verify(controller, dates, timez
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("day-view")';
   let dayStack = dayView + '/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/'
     + 'anon({"anonid":"daybox"})/[0]/anon({"anonid":"boxstack"})/anon({"anonid":"topbox"})/'
     + '{"flex":"1"}';
   let timeLine = dayView + '/anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"timebar"})/'
     + 'anon({"anonid":"topbox"})/';
   let allowedDifference = 3;
-  
+
   /* Event box' time can't be deduced from it's position in                    ----------------
      xul element tree because for each event a box is laid over whole day and  |___spacer_____|
      a spacer is added to push the event to it's correct location.             |__event_box___|
      But timeline can be used to retrieve the position of a particular hour    |day continues |
      on screen and it can be compared against the position of the event.       ----------------
   */
   for (let date = 0; date < dates.length; date++) {
     calUtils.goToDate(controller, dates[date][0], dates[date][1], dates[date][2]);
-    
+
     // find event with timezone tz
     for (let tz = 0; tz < timezones.length; tz++) {
       let found = false;
-      
+
       let correctHour = times[date][tz][0];
       let minutes = times[date][tz][1];
       let day = times[date][tz][2];
-      
-      let timeNode = (new elementslib.Lookup(controller.window.document, 
+
+      let timeNode = (new elementslib.Lookup(controller.window.document,
                                              timeLine + '[' + correctHour + ']')).getNode();
       let timeY = timeNode.boxObject.y;
       timeY += timeNode.boxObject.height * (minutes / 60);
-      
+
       let stackNode;
       let eventNodes = new Array();
-      
+
       // same day
       if(day == undefined) {
         stackNode = (new elementslib.Lookup(controller.window.document, dayStack)).getNode();
       }
-      
+
       // following day
       if(day != undefined && day == 1) {
         calUtils.forward(controller, 1);
         stackNode = (new elementslib.Lookup(controller.window.document, dayStack)).getNode();
       }
-      
+
       // previous day
       if(day != undefined && day == -1) {
         calUtils.back(controller, 1);
         stackNode = (new elementslib.Lookup(controller.window.document, dayStack)).getNode();
       }
-      
+
       calUtils.findEventsInNode(stackNode, eventNodes);
-      
+
       for (let node of eventNodes) {
         if (Math.abs(timeY - node.boxObject.y) < allowedDifference &&
                      timezones[tz] == node.mOccurrence.title) {
           found = true;
           break;
         }
       }
-      
+
       if(day != undefined && day == 1) {
         calUtils.back(controller, 1);
       }
-      
+
       if(day != undefined && day == -1) {
         calUtils.forward(controller, 1);
       }
       controller.assertJS(found == true);
     }
   }
 }
 
--- a/calendar/test/mozmill/testBasicFunctionality.js
+++ b/calendar/test/mozmill/testBasicFunctionality.js
@@ -18,60 +18,60 @@ var setupModule = function(module) {
 var testSmokeTest = function () {
   let dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                               .getService(Components.interfaces.nsIScriptableDateFormat);
   let path = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/';
 
   // open calendar view
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
-  
+
   // check for minimonth
   controller.waitForElement(new elementslib.ID(controller.window.document, "calMinimonth"));
   // every month has a first
   controller.assertNode(new elementslib.Lookup(controller.window.document, path
     + 'id("ltnSidebar")/id("minimonth-pane")/{"align":"center"}/id("calMinimonthBox")/'
     + 'id("calMinimonth")/anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
-  
+
   // check for calendar list
   controller.assertNode(new elementslib.ID(controller.window.document, "calendar-list-pane"));
   controller.assertNode(new elementslib.Lookup(controller.window.document, path
     + 'id("ltnSidebar")/id("calendar-panel")/id("calendar-list-pane")/id("calendar-listtree-pane")/'
     + 'id("calendar-list-tree-widget")/anon({"anonid":"tree"})/anon({"anonid":"treechildren"})'));
-  
+
   // check for event search
   controller.assertNode(new elementslib.ID(controller.window.document, "bottom-events-box"));
   // there should be search field
   controller.assertNode(new elementslib.ID(controller.window.document, "unifinder-search-field"));
-  
+
   // default view is day view which should have 09:00 label and box
   let label = dateService.FormatTime("", dateService.timeFormatNoSeconds, 9, 0, 0);
   controller.assertNode(new elementslib.Lookup(controller.window.document, path
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("day-view")/'
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"timebar"})/'
     + 'anon({"anonid":"topbox"})/[9]/{"class":"calendar-time-bar-label","value":"' + label + '"}'));
   controller.assertNode(new elementslib.Lookup(controller.window.document, path
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("day-view")/'
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/[0]/'
     + 'anon({"anonid":"boxstack"})/anon({"anonid":"bgbox"})/[9]'));
-    
+
   // open tasks view
   controller.click(new elementslib.ID(controller.window.document, "task-tab-button"));
   // should be possible to filter today's tasks
   controller.waitForElement(new elementslib.ID(controller.window.document, "opt_today_filter"));
   // check for task add button
   controller.assertNode(new elementslib.ID(controller.window.document, "calendar-add-task-button"));
   // check for filtered tasks list
   controller.assertNode(new elementslib.Lookup(controller.window.document, path
     + 'id("calendarDisplayDeck")/id("calendar-task-box")/[1]/id("calendar-task-tree")/'
     + 'anon({"anonid":"calendar-task-tree"})/{"tooltip":"taskTreeTooltip"}'));
-  
+
   // create test calendar
   modalDialog.plan_for_modal_dialog("Calendar:NewCalendarWizard", handleNewCalendarWizard);
-  let calendarList = new elementslib.Lookup(controller.window.document, path 
+  let calendarList = new elementslib.Lookup(controller.window.document, path
     + '/id("ltnSidebar")/id("calendar-panel")/id("calendar-list-pane")/id("calendar-listtree-pane")/'
     + 'id("calendar-list-tree-widget")/anon({"anonid":"tree"})/anon({"anonid":"treechildren"})');
   controller.doubleClick(calendarList, 0, calendarList.getNode().boxObject.height); // bottom left
   modalDialog.wait_for_modal_dialog("Calendar:NewCalendarWizard", TIMEOUT_MODAL_DIALOG);
 }
 
 function handleNewCalendarWizard(controller) {
   let docEl = controller.window.document.documentElement;
@@ -79,19 +79,19 @@ function handleNewCalendarWizard(control
   docEl.getButton("next").doCommand();
 
   // set calendar name
   let calendarNameTextBox = new elementslib.Lookup(controller.window.document, '/id("calendar-wizard")/'
     + '{"pageid":"customizePage"}/[1]/id("customize-rows")/id("customize-name-row")/'
     + 'id("calendar-name")/anon({"class":"textbox-input-box"})/anon({"anonid":"input"})');
   controller.waitForElement(calendarNameTextBox);
   controller.type(calendarNameTextBox, "Mozmill");
-  
+
   // click next
   docEl.getButton("next").doCommand();
-  
+
   // click finish
   docEl.getButton("finish").doCommand();
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, "Mozmill");
 }
--- a/calendar/test/mozmill/testLocalICS.js
+++ b/calendar/test/mozmill/testLocalICS.js
@@ -17,37 +17,37 @@ var hour = 8;
 var calendar;
 var uri;
 var file;
 var title;
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
   modalDialog = collector.getModule('window-helpers');
-  
+
   // unique name needed as deleting a calendar only unsubscribes from it
   // and if same file were used on next testrun then previously created event would show up
   let time = (new Date()).getTime() + '';
   calendar = time;
   title = time;
-  
+
   file = Services.dirsvc.get("TmpD", Components.interfaces.nsIFile);
   file.append(calendar + ".ics");
   let fileURI = Services.io.newFileURI(file);
   uri = fileURI.prePath + fileURI.path;
 }
 
 var testLocalICS = function () {
   controller.click(new elementslib.ID(controller.window.document,"calendar-tab-button"));
   calUtils.switchToView(controller, "day");
-  
+
   modalDialog.plan_for_modal_dialog("Calendar:NewCalendarWizard", handleNewCalendarWizard);
   controller.mainMenu.click("#ltnNewCalendar");
   modalDialog.wait_for_modal_dialog("Calendar:NewCalendarWizard", TIMEOUT_MODAL_DIALOG);
-  
+
   // create new event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   // let the iframe load
@@ -63,20 +63,20 @@ var testLocalICS = function () {
 
   // set calendar
   let itemCalendar = new elementslib.ID(event.window.document, "item-calendar")
   event.select(itemCalendar, undefined, calendar);
   // HACK - Wait for the value to be selected. This is needed for platforms
   // like mac where selecting the menuitem is an asynchronous process, it might
   // be fixed in a later version of mozmill.
   event.waitFor(() => itemCalendar.getNode().value == calendar);
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // assert presence in view
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour)
     + '/{"tooltip":"itemTooltip","calendar":"' + calendar + '"}';
   controller.waitForElement(new elementslib.Lookup(controller.window.document, box));
 
   // verify in file
   let fstream = Components.classes["@mozilla.org/network/file-input-stream;1"]
                           .createInstance(Components.interfaces.nsIFileInputStream);
@@ -101,35 +101,35 @@ var testLocalICS = function () {
 }
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
 }
 
 function handleNewCalendarWizard(wizard) {
   let docEl = wizard.window.document.documentElement;
-  
+
   // choose network calendar
   let remoteOption = new elementslib.Lookup(wizard.window.document, '/id("calendar-wizard")/'
     + '{"pageid":"initialPage"}/id("calendar-type")/{"value":"remote"}');
   wizard.waitForElement(remoteOption);
   wizard.radio(remoteOption);
   docEl.getButton("next").doCommand();
-  
+
   // choose ical
   let icalOption = new elementslib.Lookup(wizard.window.document, '/id("calendar-wizard")/'
     + '{"pageid":"locationPage"}/[1]/[1]/[0]/id("calendar-format")/{"value":"ics"}');
   wizard.waitForElement(icalOption);
   wizard.radio(icalOption);
   // enter location
   wizard.type(new elementslib.Lookup(wizard.window.document, '/id("calendar-wizard")/'
     + '{"pageid":"locationPage"}/[1]/[1]/{"align":"center"}/id("calendar-uri")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     uri);
   docEl.getButton("next").doCommand();
-  
+
   // name is filled in automatically using filename
   wizard.waitFor(function() {return docEl.getButton("next").disabled == false});
   docEl.getButton("next").doCommand();
-  
+
   // finish
   docEl.getButton("finish").doCommand();
 }
--- a/calendar/test/mozmill/timezoneTests/test10.js
+++ b/calendar/test/mozmill/timezoneTests/test10.js
@@ -24,20 +24,20 @@ var times = [[[18, 30], [19, 30], [20, 3
              [[18, 30], [19, 30], [20, 30], [21, 30], [22, 30], [23, 30], [0, 30, +1], [1, 30, +1]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones10_checkAdelaide = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   prefs.preferences.clearUserPref("calendar.timezone.local");
   calUtils.deleteCalendars(controller, calendar);
 }
--- a/calendar/test/mozmill/timezoneTests/test2.js
+++ b/calendar/test/mozmill/timezoneTests/test2.js
@@ -16,53 +16,53 @@ var gTimezone;
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones2_CreateEvents = function () {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   // create daily recurring events in all timezones
   let time = new Date();
   for (let i = 0; i < timezones.length; i++) {
     controller.doubleClick(new elementslib.Lookup(controller.window.document,
       calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, i + 8)), 1, 1);
     controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
     let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-    
+
     time.setHours(times[i][0]);
     time.setMinutes(times[i][1]);
-    
+
     // set timezone
     setTimezone(event, timezones[i]);
-    
+
     // set title and repeat
     calUtils.setData(event, {title:timezones[i], repeat:"weekly", starttime:time});
 
     // save
     event.click(new elementslib.ID(event.window.document, "button-save"));
     controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
   }
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[0]);
 }
 
 function setTimezone(event, timezone) {
   gTimezone = timezone;
-  
+
   // for some reason setting checked is needed, no other menuitem with checkbox needs it
   let menuitem = new elementslib.ID(event.window.document, "options-timezones-menuitem");
   event.waitForElement(menuitem);
   menuitem.getNode().setAttribute("checked", "true");
   event.click(menuitem);
-  
+
   let modal = new modalDialog.modalDialog(event.window);
   modal.start(eventCallback);
   event.waitForElement(new elementslib.ID(event.window.document, "timezone-starttime"));
   event.click(new elementslib.ID(event.window.document, "timezone-starttime"));
 }
 
 function eventCallback(timezone) {
   let item = new elementslib.XPath(timezone.window.document, "/*[name()='dialog']/"
--- a/calendar/test/mozmill/timezoneTests/test3.js
+++ b/calendar/test/mozmill/timezoneTests/test3.js
@@ -23,19 +23,19 @@ var times = [[[4, 30], [5, 30], [6, 30],
              [[4, 30], [5, 30], [6, 30], [7, 30],  [8, 30],  [9, 30], [10, 30], [11, 30]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones3_checkStJohns = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[1]);
 }
--- a/calendar/test/mozmill/timezoneTests/test4.js
+++ b/calendar/test/mozmill/timezoneTests/test4.js
@@ -23,19 +23,19 @@ var times = [[[3, 30], [4, 30], [5, 30],
              [[3, 30], [4, 30], [5, 30], [6, 30], [7, 30], [8, 30], [9, 30], [10, 30]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones4_checkCaracas = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[2]);
 }
--- a/calendar/test/mozmill/timezoneTests/test5.js
+++ b/calendar/test/mozmill/timezoneTests/test5.js
@@ -23,19 +23,19 @@ var times = [[[1, 0], [2, 0], [3, 0], [4
              [[1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones5_checkPhoenix = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[3]);
 }
--- a/calendar/test/mozmill/timezoneTests/test6.js
+++ b/calendar/test/mozmill/timezoneTests/test6.js
@@ -23,19 +23,19 @@ var times = [[[0, 0], [1, 0], [2, 0], [3
              [[0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones6_checkLosAngeles = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[4]);
 }
--- a/calendar/test/mozmill/timezoneTests/test7.js
+++ b/calendar/test/mozmill/timezoneTests/test7.js
@@ -23,19 +23,19 @@ var times = [[[5, 0], [6, 0], [7, 0], [8
              [[5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0], [12, 0]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones7_checkBuenosAires = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[5]);
 }
--- a/calendar/test/mozmill/timezoneTests/test8.js
+++ b/calendar/test/mozmill/timezoneTests/test8.js
@@ -23,19 +23,19 @@ var times = [[[9, 0], [10, 0], [11, 0], 
              [[9, 0], [10, 0], [11, 0], [12, 0], [13, 0], [14, 0], [15, 0], [16, 0]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones8_checkParis = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[6]);
 }
--- a/calendar/test/mozmill/timezoneTests/test9.js
+++ b/calendar/test/mozmill/timezoneTests/test9.js
@@ -23,19 +23,19 @@ var times = [[[13, 45], [14, 45], [15, 4
              [[13, 45], [14, 45], [15, 45], [16, 45], [17, 45], [18, 45], [19, 45], [20, 45]]]
 
 var setupModule = function(module) {
   controller = mozmill.getMail3PaneController();
 }
 
 var testTimezones9_checkKathmandu = function () {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
-  
+
   timezoneUtils.verify(controller, dates, timezones, times);
 }
 
 var teardownTest = function(module) {
   timezoneUtils.switchAppTimezone(timezones[7]);
 }
--- a/calendar/test/mozmill/views/testDayView.js
+++ b/calendar/test/mozmill/views/testDayView.js
@@ -24,50 +24,50 @@ var testDayView = function () {
     + 'id("minimonth-pane")/{"align":"center"}/id("calMinimonthBox")/id("calMinimonth")/';
   let dayView = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/'
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("day-view")/';
   let day = new elementslib.Lookup(controller.window.document, dayView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"labelbox"})/anon({"anonid":"labeldaybox"})/'
     + '{"flex":"1"}');
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
-  
+
   // open day view
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   controller.waitThenClick(new elementslib.ID(controller.window.document, "calendar-day-view-button"));
-  
+
   // pick year
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"yearcell"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"years-popup"})/[0]/{"value":"2009"}'));
-  
+
   // pick month
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"monthheader"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"months-popup"})/[0]/{"index":"0"}'));
-  
+
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
-  
+
   // verify date in view
   controller.waitFor(function() {return day.getNode().mDate.icalString == "20090101"});
 
   // create event at 8 AM
   controller.doubleClick(new elementslib.Lookup(controller.window.document, dayView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/'
     + '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/'
     + 'anon({"anonid":"bgbox"})/[8]'), 1, 1);
   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
   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, '8:00');
@@ -75,61 +75,61 @@ var testDayView = function () {
     2009, 1, 1);
   event.assertValue(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":"date-picker"})/'
     + 'anon({"flex":"1","id":"hbox","class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     date);
-    
+
   // fill in title, description and calendar
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     title1);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     desc);
   event.select(new elementslib.ID(event.window.document, "item-calendar"), null, calendar);
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // if it was created successfully, it can be opened
   let eventBox = new elementslib.Lookup(controller.window.document, dayView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/'
     + '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/'
     + 'anon({"anonid":"topbox"})/{"flex":"1"}/{"flex":"1"}/[0]/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}');
   controller.waitForElement(eventBox);
   controller.doubleClick(eventBox);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // change title and save changes
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, title2);
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // check if name was saved
   let eventName = new elementslib.Lookup(controller.window.document, dayView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/'
     + '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/'
     + 'anon({"anonid":"topbox"})/{"flex":"1"}/{"flex":"1"}/{"flex":"1"}/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}/anon({"flex":"1"})/'
     + 'anon({"anonid":"event-container"})/{"class":"calendar-event-selection"}/'
     + 'anon({"anonid":"eventbox"})/{"class":"calendar-event-details"}/anon({"anonid":"event-name"})');
   controller.waitForElement(eventName);
   controller.assertJSProperty(eventName, "textContent", title2);
-  
+
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document, dayView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/'
     + '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/'
     + 'anon({"anonid":"topbox"})/{"flex":"1"}/{"flex":"1"}/{"flex":"1"}/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}'));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
--- a/calendar/test/mozmill/views/testMonthView.js
+++ b/calendar/test/mozmill/views/testMonthView.js
@@ -26,53 +26,53 @@ var testMonthView = function () {
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("month-view")/';
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
   let eventBox = monthView + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/'
     + 'anon({"anonid":"monthgridrows"})/[0]/{"selected":"true"}/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}/anon({"flex":"1"})/'
     + '[0]/anon({"anonid":"event-container"})/{"class":"calendar-event-selection"}/'
     + 'anon({"anonid":"eventbox"})/{"class":"calendar-event-details"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   controller.waitThenClick(new elementslib.ID(controller.window.document, "calendar-month-view-button"));
-  
+
   // pick year
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"yearcell"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"years-popup"})/[0]/{"value":"2009"}'));
-  
+
   // pick month
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"monthheader"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"months-popup"})/[0]/{"index":"0"}'));
 
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
-  
+
   // verify date
   let day = new elementslib.Lookup(controller.window.document, monthView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/'
     + '[0]/{"selected":"true"}');
   controller.waitFor(function() {return day.getNode().mDate.icalString == "20090101"});
 
   // create event
   // Thursday of 2009-01-01 should be the selected box in the first row with default settings
   let hour = new Date().getHours(); // remember time at click
   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 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"})/'
@@ -83,54 +83,54 @@ var testMonthView = function () {
     2009, 1, 1);
   event.assertValue(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":"date-picker"})/'
     + 'anon({"flex":"1","id":"hbox","class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     date);
-    
+
   // fill in title, description and calendar
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     title1);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     desc);
   event.click(new elementslib.ID(event.window.document, "item-calendar"));
   event.click(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-category-color-row")/id("event-grid-category-box")/id("item-calendar")/'
     + '[0]/{"label":"' + calendar + '"}'));
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // if it was created successfully, it can be opened
   controller.waitForElement(new elementslib.Lookup(controller.window.document, eventBox));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, eventBox));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // change title and save changes
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, title2);
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // check if name was saved
   let eventName = new elementslib.Lookup(controller.window.document, eventBox
     + '/{"flex":"1"}/anon({"anonid":"event-name"})');
   controller.waitForElement(eventName);
   controller.assertValue(eventName, title2);
-  
+
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document, eventBox));
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, eventBox));
 }
 
 var teardownTest = function(module) {
--- a/calendar/test/mozmill/views/testMultiweekView.js
+++ b/calendar/test/mozmill/views/testMultiweekView.js
@@ -26,111 +26,111 @@ var testMultiWeekView = function () {
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("multiweek-view")/';
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
   let eventBox = multiWeekView + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/'
     + 'anon({"anonid":"monthgridrows"})/[0]/{"selected":"true"}/'
     + '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}/anon({"flex":"1"})/'
     + '[0]/anon({"anonid":"event-container"})/{"class":"calendar-event-selection"}/'
     + 'anon({"anonid":"eventbox"})/{"class":"calendar-event-details"}';
-  
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   controller.waitThenClick(new elementslib.ID(controller.window.document, "calendar-multiweek-view-button"));
-  
+
   // pick year
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"yearcell"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"years-popup"})/[0]/{"value":"2009"}'));
-  
+
   // pick month
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"monthheader"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"months-popup"})/[0]/{"index":"0"}'));
 
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
-  
+
   // verify date
   let day = new elementslib.Lookup(controller.window.document, multiWeekView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/'
     + '[0]/{"selected":"true"}');
   controller.waitFor(function() {return day.getNode().mDate.icalString == "20090101"});
 
   // create event
   // Thursday of 2009-01-01 should be the selected box in the first row with default settings
   let hour = new Date().getHours(); // remember time at click
   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 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); 
+  event.assertValue(startTimeInput, startTime);
   let date = dateService.FormatDate("", dateService.dateFormatShort,
     2009, 1, 1);
   event.assertValue(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":"date-picker"})/'
     + 'anon({"flex":"1","id":"hbox","class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     date);
-    
+
   // fill in title, description and calendar
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     title1);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     desc);
   event.click(new elementslib.ID(event.window.document, "item-calendar"));
   event.click(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-category-color-row")/id("event-grid-category-box")/id("item-calendar")/'
     + '[0]/{"label":"' + calendar + '"}'));
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // if it was created successfully, it can be opened
   controller.waitForElement(new elementslib.Lookup(controller.window.document, eventBox));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, eventBox));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // change title and save changes
   let titmeTextBox = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   event.waitForElement(titmeTextBox);
   event.type(titmeTextBox, title2);
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // check if name was saved
   let eventName = new elementslib.Lookup(controller.window.document, eventBox
     + '/{"flex":"1"}/anon({"anonid":"event-name"})');
   controller.waitForElement(eventName);
   controller.assertValue(eventName, title2);
-  
+
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document, eventBox));
   controller.keypress(new elementslib.ID(controller.window.document, "multiweek-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, eventBox));
 }
 
 var teardownTest = function(module) {
--- a/calendar/test/mozmill/views/testTaskView.js
+++ b/calendar/test/mozmill/views/testTaskView.js
@@ -24,135 +24,135 @@ var testTaskView = function () {
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-task-box")/';
   let taskDialog = '/id("calendar-task-dialog")/id("event-grid")/id("event-grid-rows")/';
   let treeChildren = taskView + '[1]/id("calendar-task-tree")/anon({"anonid":"calendar-task-tree"})/'
     + '{"tooltip":"taskTreeTooltip"}';
   let taskTree = taskView + '[1]/id("calendar-task-tree")';
   let toolTip = '/id("messengerWindow")/id("calendar-popupset")/id("taskTreeTooltip")';
   let toolTipGrid = toolTip + '/{"class":"tooltipBox"}/{"class":"tooltipHeaderGrid"}/';
-  
+
   // open task view
   controller.click(new elementslib.ID(controller.window.document, "task-tab-button"));
   controller.sleep(sleep);
-  
+
   // make sure that testing calendar is selected
   let calendarTree = (new elementslib.Lookup(controller.window.document,
     '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/id("tabpanelcontainer")/'
     + 'id("calendarTabPanel")/id("calendarContent")/id("ltnSidebar")/id("calendar-panel")/'
     + 'id("calendar-list-pane")/id("calendar-listtree-pane")/id("calendar-list-tree-widget")'))
     .getNode();
   for(i = 0; i < calendarTree.mCalendarList.length; i++)
     if(calendarTree.mCalendarList[i].name == calendar)
       calendarTree.tree.view.selection.select(i);
-  
+
   let taskTreeNode = (new elementslib.Lookup(controller.window.document, taskTree)).getNode();
   let countBefore = taskTreeNode.mTaskArray.length;
-  
+
   // add task
   controller.type(new elementslib.Lookup(controller.window.document, taskView
     + 'id("task-addition-box")/id("view-task-edit-field")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     title);
   controller.keypress(new elementslib.Lookup(controller.window.document, taskView
     + 'id("task-addition-box")/id("view-task-edit-field")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     "VK_RETURN",
     {});
-  
+
   // verify added
   let countAfter;
   controller.waitFor(function() {countAfter = taskTreeNode.mTaskArray.length;
                                  return countBefore + 1 == countAfter});
-  
+
   // last added task is automatically selected so verify detail window data
   controller.assertJSProperty(new elementslib.ID(controller.window.document,
     "calendar-task-details-title"), "textContent", title);
-  
+
   // open added task
   // doubleclick on completion checkbox is ignored as opening action, so don't click at immediate
   // left where the checkbox is located
   controller.doubleClick(new elementslib.Lookup(controller.window.document, treeChildren), 50, 0);
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   let task = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // verify calendar
   task.waitForElement(new elementslib.Lookup(task.window.document, taskDialog
     + 'id("event-grid-category-color-row")/id("event-grid-category-box")/id("item-calendar")/[0]/'
     + '{"selected":"true","label":"' + calendar + '"}'))
-  
+
   // add description, mark needs action and add percent complete
   task.type(new elementslib.Lookup(task.window.document, taskDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     description);
   task.click(new elementslib.ID(task.window.document, "todo-status-needsaction-menuitem"));
-  
+
   // delete default 0 percent complete
   task.keypress(new elementslib.Lookup(task.window.document, taskDialog
     + 'id("event-grid-todo-status-row")/id("event-grid-todo-status-picker-box")/'
     + 'id("percent-complete-textbox")/anon({"class":"textbox-input-box numberbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     "VK_DELETE", {});
   task.type(new elementslib.Lookup(task.window.document, taskDialog
     + 'id("event-grid-todo-status-row")/id("event-grid-todo-status-picker-box")/'
     + 'id("percent-complete-textbox")/anon({"class":"textbox-input-box numberbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     percentComplete);
-  
+
   // save
   task.click(new elementslib.ID(task.window.document, "button-save"));
   controller.waitFor(function() {return mozmill.utils.getWindows("Calendar:EventDialog").length == 0});
-  
+
   // verify description and status in details pane
   controller.assertValue(new elementslib.Lookup(controller.window.document, taskView
     + '{"flex":"1"}/id("calendar-task-details-container")/id("calendar-task-details-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     description);
   let status = utils.getProperty("chrome://calendar/locale/calendar.properties",
     "taskDetailsStatusNeedsAction");
   controller.assertValue(new elementslib.ID(controller.window.document, "calendar-task-details-status"),
     status);
-  
+
   // set high priority and verify it in detail pane
   controller.click(new elementslib.ID(controller.window.document, "task-actions-priority"));
   controller.sleep(sleep);
   controller.click(new elementslib.ID(controller.window.document, "priority-1-menuitem"));
   controller.sleep(sleep);
   let priorityNode = new elementslib.ID(controller.window.document, "calendar-task-details-priority-high");
   controller.assertNotDOMProperty(priorityNode, "hidden");
-  
+
   // verify that tooltip shows status, priority and percent complete
   let toolTipNode = new elementslib.Lookup(controller.window.document, toolTip).getNode();
   toolTipNode.ownerDocument.defaultView.showToolTip(toolTipNode, taskTreeNode.getTaskAtRow(0));
-  
+
   let toolTipName = new elementslib.Lookup(controller.window.document, toolTipGrid + '[1]/[0]/[1]');
   let toolTipCalendar = new elementslib.Lookup(controller.window.document, toolTipGrid + '[1]/[1]/[1]');
   let toolTipPriority = new elementslib.Lookup(controller.window.document, toolTipGrid + '[1]/[2]/[1]');
   let toolTipStatus = new elementslib.Lookup(controller.window.document, toolTipGrid + '[1]/[3]/[1]');
   let toolTipComplete = new elementslib.Lookup(controller.window.document, toolTipGrid + '[1]/[4]/[1]');
   let priority = utils.getProperty("chrome://calendar/locale/calendar.properties",
     "highPriority");
-  
+
   controller.assertJSProperty(toolTipName, "textContent", title);
   controller.assertJSProperty(toolTipCalendar, "textContent", calendar);
   controller.assertJSProperty(toolTipPriority, "textContent", priority);
   controller.assertJS(toolTipStatus.getNode().textContent.toLowerCase() == status.toLowerCase());
   controller.assertJSProperty(toolTipComplete, "textContent", percentComplete + '%');
-  
+
   // mark completed, verify
   controller.click(new elementslib.ID(controller.window.document,
                                       "task-actions-markcompleted"));
   controller.sleep(sleep);
-  
+
   status = utils.getProperty("chrome://calendar/locale/calendar.properties",
     "taskDetailsStatusCompleted");
   toolTipNode.ownerDocument.defaultView.showToolTip(toolTipNode, taskTreeNode.getTaskAtRow(0));
   controller.assertJS(toolTipStatus.getNode().textContent.toLowerCase() == status.toLowerCase());
-  
+
   // delete task, verify
   controller.click(new elementslib.ID(controller.window.document, "task-context-menu-delete"));
   controller.click(new elementslib.ID(controller.window.document, "calendar-delete-task-button"));
   let countAfterDelete = taskTreeNode.mTaskArray.length;
   controller.assertJS(countAfter - 1 == countAfterDelete);
 }
 
 var teardownTest = function(module) {
--- a/calendar/test/mozmill/views/testWeekView.js
+++ b/calendar/test/mozmill/views/testWeekView.js
@@ -25,52 +25,52 @@ var testWeekView = function () {
   let weekView = '/id("messengerWindow")/id("tabmail-container")/id("tabmail")/'
     + 'id("tabpanelcontainer")/id("calendarTabPanel")/id("calendarContent")/'
     + 'id("calendarDisplayDeck")/id("calendar-view-box")/id("view-deck")/id("week-view")/';
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
   let eventBox = weekView + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/'
     + 'anon({"anonid":"daybox"})/[4]/anon({"anonid":"boxstack"})/anon({"anonid":"topbox"})/'
     + '{"flex":"1"}/{"flex":"1"}/{"flex":"1"}/{"tooltip":"itemTooltip","calendar":"'
     + calendar.toLowerCase() + '"}';
-    
+
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   controller.waitThenClick(new elementslib.ID(controller.window.document, "calendar-week-view-button"));
-  
+
   // pick year
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"yearcell"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"years-popup"})/[0]/{"value":"2009"}'));
-  
+
   // pick month
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"monthheader"})'));
   controller.click(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/'
     + 'anon({"anonid":"months-popup"})/[0]/{"index":"0"}'));
 
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth
     + 'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
-  
+
   // verify date
   let day = new elementslib.Lookup(controller.window.document, weekView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"labelbox"})/anon({"anonid":"labeldaybox"})/'
     + '{"selected":"true"}');
   controller.waitFor(function() {return day.getNode().mDate.icalString == "20090101"});
 
   // create event at 8 AM
   // Thursday of 2009-01-01 is 4th with default settings
   controller.doubleClick(new elementslib.Lookup(controller.window.document, weekView
     + 'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/'
     + '[4]/anon({"anonid":"boxstack"})/anon({"anonid":"bgbox"})/[8]'), 1, 1);
   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
   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, '8:00');
@@ -78,53 +78,53 @@ var testWeekView = function () {
     2009, 1, 1);
   event.assertValue(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":"date-picker"})/'
     + 'anon({"flex":"1","id":"hbox","class":"datepicker-box-class"})/'
     + '{"class":"datepicker-text-class"}/anon({"class":"menulist-editable-box textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     date);
-    
+
   // fill in title, description and calendar
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})'),
     title1);
   event.type(new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-description-row")/id("item-description")/'
     + 'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     desc);
   event.select(new elementslib.ID(event.window.document, "item-calendar"), null, calendar);
-  
+
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // if it was created successfully, it can be opened
   controller.waitForElement(new elementslib.Lookup(controller.window.document, eventBox));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, eventBox));
   controller.waitFor(function () {return utils.getWindows("Calendar:EventDialog").length > 0}, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
-  
+
   // change title and save changes
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog
     + 'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/'
     + 'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, title2);
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  
+
   // check if name was saved
   let eventName = new elementslib.Lookup(controller.window.document, eventBox
     + '/anon({"flex":"1"})/anon({"anonid":"event-container"})/{"class":"calendar-event-selection"}/'
     + 'anon({"anonid":"eventbox"})/{"class":"calendar-event-details"}/'
     + 'anon({"anonid":"event-name"})');
   controller.waitForElement(eventName);
   controller.assertJSProperty(eventName, "textContent", title2);
-  
+
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document, eventBox));
   controller.keypress(new elementslib.ID(controller.window.document, "week-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, eventBox));
 }
 
 var teardownTest = function(module) {
--- a/calendar/test/unit/test_calutils.js
+++ b/calendar/test/unit/test_calutils.js
@@ -55,17 +55,17 @@ function getAttendeeEmail_test() {
         if (test.input.cn) {
             attendee.commonName = test.input.cn;
         }
         if (test.input.email) {
             attendee.setProperty("EMAIL", test.input.email);
         }
         equal(cal.getAttendeeEmail(attendee, test.input.useCn), test.expected, "(test #" + i + ")");
     }
-};
+}
 
 function getRecipientList_test() {
     let data = [{
         input: [{id: "mailto:first@example.net", cn: null},
                 {id: "mailto:second@example.net", cn: null},
                 {id: "mailto:third@example.net", cn: null}],
         expected: "first@example.net, second@example.net, third@example.net"
     }, {
@@ -101,41 +101,41 @@ function getRecipientList_test() {
             attendee.id = att.id;
             if (att.cn) {
                 attendee.commonName = att.cn;
             }
             attendees.push(attendee);
         }
         equal(cal.getRecipientList(attendees), test.expected, "(test #" + i + ")");
     }
-};
+}
 
 function prependMailTo_test() {
     let data = [{input: "mailto:first.last@example.net", expected: "mailto:first.last@example.net"},
                 {input: "MAILTO:first.last@example.net", expected: "mailto:first.last@example.net"},
                 {input: "first.last@example.net", expected: "mailto:first.last@example.net"},
                 {input: "first.last.example.net", expected: "first.last.example.net"}];
     let i = 0;
     for (let test of data) {
         i++;
         equal(cal.prependMailTo(test.input), test.expected, "(test #" + i + ")");
     }
-};
+}
 
 function removeMailTo_test() {
     let data = [{input: "mailto:first.last@example.net", expected: "first.last@example.net"},
                 {input: "MAILTO:first.last@example.net", expected: "first.last@example.net"},
                 {input: "first.last@example.net", expected: "first.last@example.net"},
                 {input: "first.last.example.net", expected: "first.last.example.net"}];
     let i = 0;
     for (let test of data) {
         i++;
         equal(cal.removeMailTo(test.input), test.expected, "(test #" + i + ")");
     }
-};
+}
 
 function resolveDelegation_test() {
     let data = [{
         input: {
             attendee:
                 'ATTENDEE;DELEGATED-FROM="mailto:attendee2@example.net";CN="Attendee 1":mailto:at' +
                 'tendee1@example.net',
             attendees: [
@@ -271,9 +271,9 @@ function validateRecipientList_test() {
                   "le.net>, \"last3, first3\" <first3.last2@example.net>"
     }];
     let i = 0;
     for (let test of data) {
         i++;
         equal(cal.validateRecipientList(test.input), test.expected,
               "(test #" + i + ")");
     }
-};
+}
--- a/calendar/test/unit/test_datetime_before_1970.js
+++ b/calendar/test/unit/test_datetime_before_1970.js
@@ -1,32 +1,32 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
-
-    // Bug 769938 - dates before 1970 are not handled correctly
-    // due to signed vs. unsigned mismatch in PRTime in xpconnect
-
-    let dateTime1950 = cal.createDateTime();
-    dateTime1950.year = 1950;
-    equal(dateTime1950.year, 1950);
-
-    let dateTime1955 = cal.jsDateToDateTime(new Date(1955, 06, 15));
-    equal(dateTime1955.year, 1955);
-    
-    let dateTime1965 = cal.createDateTime();
-    dateTime1965.nativeTime = -150000000000000;
-    equal(dateTime1965.year, 1965);
-    equal(dateTime1965.nativeTime, -150000000000000);
-
-    let dateTime1990 = cal.createDateTime();
-    dateTime1990.year = 1990;
-
-    let dateTime2050 = cal.createDateTime();
-    dateTime2050.year = 2050;
-
-    ok(dateTime1950.nativeTime < dateTime1955.nativeTime);
-    ok(dateTime1955.nativeTime < dateTime1965.nativeTime);
-    ok(dateTime1965.nativeTime < dateTime1990.nativeTime);
-    ok(dateTime1990.nativeTime < dateTime2050.nativeTime);
-}
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+function run_test() {
+
+    // Bug 769938 - dates before 1970 are not handled correctly
+    // due to signed vs. unsigned mismatch in PRTime in xpconnect
+
+    let dateTime1950 = cal.createDateTime();
+    dateTime1950.year = 1950;
+    equal(dateTime1950.year, 1950);
+
+    let dateTime1955 = cal.jsDateToDateTime(new Date(1955, 6, 15));
+    equal(dateTime1955.year, 1955);
+
+    let dateTime1965 = cal.createDateTime();
+    dateTime1965.nativeTime = -150000000000000;
+    equal(dateTime1965.year, 1965);
+    equal(dateTime1965.nativeTime, -150000000000000);
+
+    let dateTime1990 = cal.createDateTime();
+    dateTime1990.year = 1990;
+
+    let dateTime2050 = cal.createDateTime();
+    dateTime2050.year = 2050;
+
+    ok(dateTime1950.nativeTime < dateTime1955.nativeTime);
+    ok(dateTime1955.nativeTime < dateTime1965.nativeTime);
+    ok(dateTime1965.nativeTime < dateTime1990.nativeTime);
+    ok(dateTime1990.nativeTime < dateTime2050.nativeTime);
+}
--- a/calendar/test/unit/test_deleted_items.js
+++ b/calendar/test/unit/test_deleted_items.js
@@ -13,17 +13,17 @@ function check_delmgr_call(aFunc) {
     let delmgr = Components.classes["@mozilla.org/calendar/deleted-items-manager;1"]
                            .getService(Components.interfaces.calIDeletedItems);
     return new Promise(function(resolve, reject) {
         delmgr.wrappedJSObject.completedNotifier.handleCompletion = (aReason) => {
             if (aReason == mISSC.REASON_FINISHED) {
                 resolve();
             } else {
                 reject(aReason);
-            };
+            }
         };
         aFunc();
     });
 }
 
 add_task(function* test_deleted_items() {
     let calmgr = cal.getCalendarManager();
     let delmgr = Components.classes["@mozilla.org/calendar/deleted-items-manager;1"]
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -231,16 +231,17 @@ GDataServer.prototype = {
                 body = JSON.parse(NetUtil.readInputStreamToString(request.bodyInputStream,
                                   request.bodyInputStream.available()));
             } catch (e) {}
 
             this.lastMethod = method;
             return nextHandler(request, response, method, parameters, body);
         } catch (e) {
             do_print("Server Error: " + e.fileName + ":" + e.lineNumber + ": " + e + "\n");
+            return null;
         }
     },
 
     calendarListRequest: function(request, response, method, parameters, body) {
         let data = this.calendarListData;
         response.write(JSON.stringify(data));
     },
 
--- a/calendar/test/unit/test_providers.js
+++ b/calendar/test/unit/test_providers.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var icalStringArray = [
                 // Comments refer to the range defined in testGetItems().
                 // 1: one-hour event
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T114500Z\n" +
                 "DTEND:20020402T124500Z\n" +
                 "END:VEVENT\n",
                 // 2: Test a zero-length event with DTSTART and DTEND
                 "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T000000Z\n" +
                 "DTEND:20020402T000000Z\n" +
                 "END:VEVENT\n",
@@ -18,76 +18,76 @@ var icalStringArray = [
                 "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T000000Z\n" +
                 "END:VEVENT\n",
                 // 4: Test a zero-length event with DTEND set and no  DTSTART. Invalid!
                 "BEGIN:VEVENT\n" +
                 "DTEND:20020402T000000Z\n" +
                 "END:VEVENT\n",
                 // 5: one-hour event that is outside the range
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020401T114500Z\n" +
                 "DTEND:20020401T124500Z\n" +
                 "END:VEVENT\n",
                 // 6: one-hour event that starts outside the range and ends inside.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020401T114500Z\n" +
                 "DTEND:20020402T124500Z\n" +
                 "END:VEVENT\n",
                 // 7:  one-hour event that starts inside the range and ends outside.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T114500Z\n" +
                 "DTEND:20020403T124500Z\n" +
                 "END:VEVENT\n",
                 // 8: one-hour event that starts at the end of the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020403T000000Z\n" +
                 "DTEND:20020403T124500Z\n" +
                 "END:VEVENT\n",
                 // 9: allday event that starts at start of range and ends at end of range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART;VALUE=DATE:20020402\n" +
                 "DTEND;VALUE=DATE:20020403\n" +
                 "END:VEVENT\n",
                 // 10: allday event that starts at end of range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART;VALUE=DATE:20020403\n" +
                 "DTEND;VALUE=DATE:20020404\n" +
                 "END:VEVENT\n",
                 // 11: allday event that ends at start of range. See bug 333363.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART;VALUE=DATE:20020401\n" +
                 "DTEND;VALUE=DATE:20020402\n" +
                 "END:VEVENT\n",
                 // 12: daily recurring allday event. parent item in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART;VALUE=DATE:20020402\n" +
                 "DTEND;VALUE=DATE:20020403\n" +
                 "RRULE:FREQ=DAILY;INTERVAL=1;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 13: daily recurring allday event. First occurence in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART;VALUE=DATE:20020401\n" +
                 "DTEND;VALUE=DATE:20020402\n" +
                 "RRULE:FREQ=DAILY;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 14: two-daily recurring allday event. Not in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART;VALUE=DATE:20020401\n" +
                 "DTEND;VALUE=DATE:20020402\n" +
                 "RRULE:FREQ=DAILY;INTERVAL=2;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 15: daily recurring one-hour event. Parent in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T100000Z\n" +
                 "DTEND:20020402T110000Z\n" +
                 "RRULE:FREQ=DAILY;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 16: daily recurring one-hour event. Occurrence in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020401T100000Z\n" +
                 "DTEND:20020401T110000Z\n" +
                 "RRULE:FREQ=DAILY;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 17: zero-length task with DTSTART and DUE set at start of range.
                 "BEGIN:VTODO\n" +
                 "DTSTART:20020402T000000Z\n" +
                 "DUE:20020402T000000Z\n" +
@@ -111,23 +111,23 @@ var icalStringArray = [
                 "DUE:20020403T010000Z\n" +
                 "END:VTODO\n",
                 // 22: one-hour todo that ends at start of range.
                 "BEGIN:VTODO\n" +
                 "DTSTART:20020401T230000Z\n" +
                 "DUE:20020402T000000Z\n" +
                 "END:VTODO\n",
                 // 23: daily recurring one-hour event. Parent in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T000000\n" +
                 "DTEND:20020402T010000\n" +
                 "RRULE:FREQ=DAILY;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 24: daily recurring 24-hour event. Parent in the range.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T000000\n" +
                 "DTEND:20020403T000000\n" +
                 "RRULE:FREQ=DAILY;COUNT=10\n" +
                 "END:VEVENT\n",
                 // 25: todo that has neither start nor due date set.
                 // Should be returned on every getItems() call. See bug 405459.
                 "BEGIN:VTODO\n" +
                 "SUMMARY:Todo\n" +
@@ -152,47 +152,47 @@ var icalStringArray = [
                 "END:VTODO\n",
                 // 29: todo that has neither start nor due date set,
                 // has the status "COMPLETED" but no completion time. See bug 405459.
                 "BEGIN:VTODO\n" +
                 "SUMMARY:Todo\n" +
                 "STATUS:COMPLETED\n" +
                 "END:VTODO\n",
                 // 30: one-hour event with duration (in the range). See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T114500Z\n" +
                 "DURATION:PT1H\n" +
                 "END:VEVENT\n",
                 // 31: one-hour event with duration (after the range). See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020403T000000Z\n" +
                 "DURATION:PT1H\n" +
                 "END:VEVENT\n",
                 // 32: one-hour event with duration (before the range). See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020401T230000Z\n" +
                 "DURATION:PT1H\n" +
                 "END:VEVENT\n",
                 // 33: one-day event with duration. Starts in the range, Ends outside. See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020402T120000Z\n" +
                 "DURATION:P1D\n" +
                 "END:VEVENT\n",
                 // 34: one-day event with duration. Starts before the range. Ends inside. See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020401T120000Z\n" +
                 "DURATION:P1D\n" +
                 "END:VEVENT\n",
                 // 35: one-day event with duration (before the range). See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020401T000000Z\n" +
                 "DURATION:P1D\n" +
                 "END:VEVENT\n",
                 // 36: one-day event with duration (after the range). See bug 390492.
-                "BEGIN:VEVENT\n" + 
+                "BEGIN:VEVENT\n" +
                 "DTSTART:20020403T000000Z\n" +
                 "DURATION:P1D\n" +
                 "END:VEVENT\n"
                 ];
 
 function run_test() {
     // First entry is test number, second item is expected result for testGetItems().
     var wantedArray = [[ 1, 1],
@@ -226,25 +226,26 @@ function run_test() {
                        [ 30, 1],
                        [ 31, 0],
                        [ 32, 0],
                        [ 33, 1],
                        [ 34, 1],
                        [ 35, 0],
                        [ 36, 0]];
 
-    for (var i = 0; i < wantedArray.length; i++) {
-        var itemArray = wantedArray[i];
+    for (let i = 0; i < wantedArray.length; i++) {
+        let itemArray = wantedArray[i];
         // Correct for 1 to stay in synch with test numbers.
-        var calItem = icalStringArray[itemArray[0] - 1];
+        let calItem = icalStringArray[itemArray[0] - 1];
 
+        let item;
         if (calItem.search(/VEVENT/) != -1) {
-            var item = createEventFromIcalString(calItem);
+            item = createEventFromIcalString(calItem);
         } else if (calItem.search(/VTODO/) != -1) {
-            var item = createTodoFromIcalString(calItem);
+            item = createTodoFromIcalString(calItem);
         }
 
         print("Test " + wantedArray[i][0]);
         testGetItems(item, itemArray[1]);
         testGetItem(item);
     }
 
    /**
@@ -262,17 +263,17 @@ function run_test() {
 
     function checkCalendar(calendar, aItem, aResult) {
         // construct range
         var rangeStart = createDate(2002, 3, 2); // 3 = April
         var rangeEnd = rangeStart.clone();
         rangeEnd.day += 1;
 
         // filter options
-        var filter = Ci.calICalendar.ITEM_FILTER_TYPE_ALL | 
+        var filter = Ci.calICalendar.ITEM_FILTER_TYPE_ALL |
                      Ci.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES |
                      Ci.calICalendar.ITEM_FILTER_COMPLETED_ALL;
 
         // implement listener
         var count = 0;
         var listener = {
             onOperationComplete: function(aCalendar,
                                           aStatus,
--- a/calendar/test/unit/test_recur.js
+++ b/calendar/test/unit/test_recur.js
@@ -214,17 +214,17 @@ function test_rules() {
                                           "DESCRIPTION:Repeat Yearly the last day of February\n" +
                                           "RRULE:FREQ=YEARLY;COUNT=6;BYMONTHDAY=-1;BYMONTH=2\n" +
                                           "DTSTART:20140228T220000Z\n" +
                                           "DTEND:20140228T230000Z\n" +
                                           "END:VEVENT\nEND:VCALENDAR\n"),
                 ["20140228T220000Z", "20150228T220000Z", "20160229T220000Z",
                  "20170228T220000Z", "20180228T220000Z", "20190228T220000Z"],
                 false);
-               
+
     // Bug 958978: Yearly recurrence, the last day of a not specified month.
     check_recur(createEventFromIcalString("BEGIN:VCALENDAR\nBEGIN:VEVENT\n" +
                                           "DESCRIPTION:Repeat Yearly the last day of April without BYMONTH=4 in the rule\n" +
                                           "RRULE:FREQ=YEARLY;COUNT=6;BYMONTHDAY=-1\n" +
                                           "DTSTART:20140430T220000Z\n" +
                                           "DTEND:20140430T230000Z\n" +
                                           "END:VEVENT\nEND:VCALENDAR\n"),
                 ["20140430T220000Z", "20150430T220000Z", "20160430T220000Z",
@@ -814,99 +814,99 @@ function test_immutable() {
 }
 
 function test_rrule_icalstring() {
     var recRule = createRecurrenceRule();
     recRule.type = "DAILY";
     recRule.interval = 4;
     equal(recRule.icalString, "RRULE:FREQ=DAILY;INTERVAL=4\r\n");
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "DAILY";
     recRule.setComponent("BYDAY", 5, [2, 3, 4, 5, 6]);
     equal(recRule.icalString, "RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR\r\n");
     deepEqual(recRule.getComponent("BYDAY", {}), [2, 3, 4, 5, 6]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "WEEKLY";
     recRule.interval = 3;
     recRule.setComponent("BYDAY", 3, [2, 4, 6]);
     equal(recRule.icalString, "RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO,WE,FR\r\n");
     deepEqual(recRule.getComponent("BYDAY", {}), [2, 4, 6]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "MONTHLY";
     recRule.setComponent("BYDAY", 7, [2,3,4,5,6,7,1]);
     equal(recRule.icalString, "RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n");
     deepEqual(recRule.getComponent("BYDAY", {}), [2,3,4,5,6,7,1]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "MONTHLY";
     recRule.setComponent("BYDAY", 1, [10]);
     equal(recRule.icalString, "RRULE:FREQ=MONTHLY;BYDAY=1MO\r\n");
     deepEqual(recRule.getComponent("BYDAY", {}), [10]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "MONTHLY";
     recRule.setComponent("BYDAY", 1, [20]);
     equal(recRule.icalString, "RRULE:FREQ=MONTHLY;BYDAY=2WE\r\n");
     deepEqual(recRule.getComponent("BYDAY", {}), [20]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "MONTHLY";
     recRule.setComponent("BYDAY", 1, [-22]);
     equal(recRule.icalString, "RRULE:FREQ=MONTHLY;BYDAY=-2FR\r\n");
     deepEqual(recRule.getComponent("BYDAY", {}), [-22]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "MONTHLY";
     recRule.setComponent("BYMONTHDAY", 1, [5]);
     equal(recRule.icalString, "RRULE:FREQ=MONTHLY;BYMONTHDAY=5\r\n");
     deepEqual(recRule.getComponent("BYMONTHDAY", {}), [5]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "MONTHLY";
     recRule.setComponent("BYMONTHDAY", 3, [1, 9, 17]);
     equal(recRule.icalString, "RRULE:FREQ=MONTHLY;BYMONTHDAY=1,9,17\r\n");
     deepEqual(recRule.getComponent("BYMONTHDAY", {}), [1, 9, 17]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "YEARLY";
     recRule.setComponent("BYMONTH", 1, [1]);
     recRule.setComponent("BYMONTHDAY", 1, [3]);
     ok([
         "RRULE:FREQ=YEARLY;BYMONTHDAY=3;BYMONTH=1\r\n",
         "RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=3\r\n"
     ].includes(recRule.icalString));
     deepEqual(recRule.getComponent("BYMONTH", {}), [1]);
     deepEqual(recRule.getComponent("BYMONTHDAY", {}), [3]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "YEARLY";
     recRule.setComponent("BYMONTH", 1, [4]);
     recRule.setComponent("BYDAY", 1, [3]);
     ok([
         "RRULE:FREQ=YEARLY;BYDAY=TU;BYMONTH=4\r\n",
         "RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=TU\r\n"
     ].includes(recRule.icalString));
     deepEqual(recRule.getComponent("BYMONTH", {}), [4]);
     deepEqual(recRule.getComponent("BYDAY", {}), [3]);
 
-    var recRule = createRecurrenceRule();
+    recRule = createRecurrenceRule();
     recRule.type = "YEARLY";
     recRule.setComponent("BYMONTH", 1, [4]);
     recRule.setComponent("BYDAY", 1, [10]);