Bug 1280898 - Set up eslint for calendar files - enable array-bracket-spacing rule. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Fri, 08 Jul 2016 14:00:28 +0200
changeset 25977 c764e438746ecce89471a5f4da04828466463bc2
parent 25976 553bba9bac6170bf502c352648823625cad9e606
child 25978 3e5200802c519241db36516447900697389094c4
push id1771
push userclokep@gmail.com
push dateMon, 14 Nov 2016 17:47:53 +0000
treeherdercomm-beta@399ae9d71595 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1280898
Bug 1280898 - Set up eslint for calendar files - enable array-bracket-spacing rule. r=MakeMyDay MozReview-Commit-ID: K9EFqfzuNww
calendar/.eslintrc
calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
calendar/base/content/dialogs/calendar-event-dialog-reminder.js
calendar/base/content/today-pane.js
calendar/base/modules/calExtract.jsm
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/modules/calUtils.jsm
calendar/base/src/calAlarm.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calUtils.js
calendar/providers/caldav/calDavCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/wcap/calWcapSession.js
calendar/resources/content/calendarCreation.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_providers.js
--- a/calendar/.eslintrc
+++ b/calendar/.eslintrc
@@ -217,16 +217,19 @@
     // Disallow global and local variables that aren't used, but allow unused function arguments.
     "no-unused-vars": [2, {"vars": "all", "args": "none", "varsIgnorePattern": "EXPORTED_SYMBOLS"}],
 
     "mozilla/mark-test-function-used": 1,
 
     // Require padding inside curly braces
     "object-curly-spacing": [2, "always"],
 
+    // Disallow spaces inside of brackets
+    "array-bracket-spacing": [2, "never"],
+
     // Disallow control characters in regular expressions
     "no-control-regex": 2,
 
     // Disallow invalid regular expression strings in RegExp constructors
     "no-invalid-regexp": 2,
 
     // Disallow multiple spaces in regular expression literals
     "no-regex-spaces": 2,
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -1080,37 +1080,37 @@
         function cycle(values, current) {
             let nextIndex = (values.indexOf(current) + 1) % values.length;
             return values[nextIndex];
         }
 
         let target = event.originalTarget;
         if (target.className == "role-icon") {
             if (target.getAttribute("disabled") != "true") {
-                const roleCycle = [ "REQ-PARTICIPANT", "OPT-PARTICIPANT",
-                                    "NON-PARTICIPANT", "CHAIR" ];
+                const roleCycle = ["REQ-PARTICIPANT", "OPT-PARTICIPANT",
+                                   "NON-PARTICIPANT", "CHAIR"];
 
                 let nextValue = cycle(roleCycle, target.getAttribute("role"));
                 target.setAttribute("role", nextValue);
                 this.updateTooltip(target);
             }
         } else if (target.className == "status-icon") {
             if (target.getAttribute("disabled") != "true") {
-                const statusCycle = [ "ACCEPTED", "DECLINED", "TENTATIVE" ];
+                const statusCycle = ["ACCEPTED", "DECLINED", "TENTATIVE"];
 
                 let nextValue = cycle(statusCycle, target.getAttribute("status"));
                 target.setAttribute("status", nextValue);
                 this.updateTooltip(target);
             }
         } else if (target.className == "usertype-icon") {
             let fieldNum = target.getAttribute("id").split("#")[1];
             let inputField = this.getInputElement(fieldNum);
             if (target.getAttribute("disabled") != "true" &&
                 !inputField.attendee.isOrganizer) {
-                const cutypeCycle = [ "INDIVIDUAL", "GROUP", "RESOURCE", "ROOM" ];
+                const cutypeCycle = ["INDIVIDUAL", "GROUP", "RESOURCE", "ROOM"];
 
                 let nextValue = cycle(cutypeCycle, target.getAttribute("cutype"));
                 target.setAttribute("cutype", nextValue);
                 this.updateTooltip(target);
             }
         } else if (this.mIsReadOnly || this.mIsInvitation || target == null ||
                    (target.localName != "listboxbody" &&
                     target.localName != "listcell" &&
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -316,56 +316,56 @@ function onSave(item) {
             let monthlyOrdinal = Number(getElementValue("monthly-monthlyOrdinal"));
             let monthlyDOW = Number(getElementValue("monthly-weekday"));
             if (monthlyDOW < 0) {
                 if (monthlyOrdinal == 0) {
                     // Monthly rule "Every day of the month".
                     recRule.setComponent("BYDAY", 7, ALL_WEEKDAYS);
                 } else {
                     // One of the first five days or the last day of the month.
-                    recRule.setComponent("BYMONTHDAY", 1, [ monthlyOrdinal ]);
+                    recRule.setComponent("BYMONTHDAY", 1, [monthlyOrdinal]);
                 }
             } else {
                 let sign = monthlyOrdinal < 0 ? -1 : 1;
-                let onDays = [ (Math.abs(monthlyOrdinal) * 8 + monthlyDOW) * sign ];
+                let onDays = [(Math.abs(monthlyOrdinal) * 8 + monthlyDOW) * sign];
                 recRule.setComponent("BYDAY", onDays.length, onDays);
             }
         } else {
             let monthlyDays = document.getElementById("monthly-days").days;
             if (monthlyDays.length > 0) {
                 recRule.setComponent("BYMONTHDAY", monthlyDays.length, monthlyDays);
             }
         }
         break;
     case 3:
         recRule.type = "YEARLY";
         let yearInterval = Number(getElementValue("yearly-interval"));
         recRule.interval = yearInterval;
         let yearlyGroup = document.getElementById("yearly-group");
         if (yearlyGroup.selectedIndex == 0) {
-            let yearlyByMonth = [ Number(getElementValue("yearly-month-ordinal")) ];
+            let yearlyByMonth = [Number(getElementValue("yearly-month-ordinal"))];
             recRule.setComponent("BYMONTH", yearlyByMonth.length, yearlyByMonth);
-            let yearlyByDay = [ Number(getElementValue("yearly-days")) ];
+            let yearlyByDay = [Number(getElementValue("yearly-days"))];
             recRule.setComponent("BYMONTHDAY", yearlyByDay.length, yearlyByDay);
         } else {
-            let yearlyByMonth = [ Number(getElementValue("yearly-month-rule")) ];
+            let yearlyByMonth = [Number(getElementValue("yearly-month-rule"))];
             recRule.setComponent("BYMONTH", yearlyByMonth.length, yearlyByMonth);
             let yearlyOrdinal = Number(getElementValue("yearly-ordinal"));
             let yearlyDOW = Number(getElementValue("yearly-weekday"));
             if (yearlyDOW < 0) {
                 if (yearlyOrdinal == 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, [ yearlyOrdinal ]);
+                    recRule.setComponent("BYMONTHDAY", 1, [yearlyOrdinal]);
                 }
             } else {
                 let sign = yearlyOrdinal < 0 ? -1 : 1;
-                let onDays = [ (Math.abs(yearlyOrdinal) * 8 + yearlyDOW) * sign ];
+                let onDays = [(Math.abs(yearlyOrdinal) * 8 + yearlyDOW) * sign];
                 recRule.setComponent("BYDAY", onDays.length, onDays);
             }
         }
         break;
     }
 
     // Figure out how long this event is supposed to last
     switch (document.getElementById("recurrence-duration").selectedItem.value) {
--- a/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
@@ -37,17 +37,17 @@ function onLoad() {
 
     setElementValue("reminder-after-end-menuitem",
                     _sn("reminderCustomOriginEndAfter"),
                     "label");
 
 
     // Set up the action map
     let supportedActions = calendar.getProperty("capabilities.alarms.actionValues") ||
-                           ["DISPLAY" /* TODO email support, "EMAIL" */];
+                           ["DISPLAY"]; // TODO email support, "EMAIL"
     for (let action of supportedActions) {
         allowedActionsMap[action] = true;
     }
 
     // Hide all actions that are not supported by this provider
     let firstAvailableItem;
     let actionNodes = document.getElementById("reminder-actions-menupopup").childNodes;
     for (let actionNode of actionNodes) {
--- a/calendar/base/content/today-pane.js
+++ b/calendar/base/content/today-pane.js
@@ -20,19 +20,19 @@ var TodayPane = {
         distance: 0,
         session: false
     },
 
     /**
      * Load Handler, sets up the today pane controls.
      */
     onLoad: function onLoad() {
-        TodayPane.paneViews = [ cal.calGetString("calendar", "eventsandtasks"),
-                                cal.calGetString("calendar", "tasksonly"),
-                                cal.calGetString("calendar", "eventsonly") ];
+        TodayPane.paneViews = [cal.calGetString("calendar", "eventsandtasks"),
+                               cal.calGetString("calendar", "tasksonly"),
+                               cal.calGetString("calendar", "eventsonly")];
         agendaListbox.setupCalendar();
         TodayPane.initializeMiniday();
         TodayPane.setShortWeekdays();
 
         document.getElementById("modeBroadcaster").addEventListener("DOMAttrModified", TodayPane.onModeModified, false);
         TodayPane.setTodayHeader();
 
         document.getElementById("today-splitter").addEventListener("command", onCalendarViewResize, false);
--- a/calendar/base/modules/calExtract.jsm
+++ b/calendar/base/modules/calExtract.jsm
@@ -357,17 +357,17 @@ Extractor.prototype = {
         this.markContained();
         this.collected = this.collected.sort(this.sort);
 
         return this.collected;
     },
 
     extractDayMonthYear: function extractDayMonthYear(pattern, relation) {
         let alts = this.getRepPatterns(pattern, ["(\\d{1,2})", "(\\d{1,2})",
-                                                "(\\d{2,4})" ]);
+                                                 "(\\d{2,4})"]);
         let res;
         for (let alt in alts) {
             let positions = alts[alt].positions;
             let re = new RegExp(alts[alt].pattern, "ig");
 
             while ((res = re.exec(this.email)) != null) {
                 if (!this.limitNums(res, this.email) && !this.limitChars(res, this.email)) {
                     let day = parseInt(res[positions[1]], 10);
@@ -382,18 +382,18 @@ Extractor.prototype = {
                     }
                 }
             }
         }
     },
 
     extractDayMonthNameYear: function extractDayMonthNameYear(pattern, relation) {
         let alts = this.getRepPatterns(pattern, ["(\\d{1,2})",
-                                                "(" + this.allMonths + ")",
-                                                "(\\d{2,4})" ]);
+                                                 "(" + this.allMonths + ")",
+                                                 "(\\d{2,4})"]);
         let res;
         for (let alt in alts) {
             let exp = alts[alt].pattern.split(this.marker).join("|");
             let positions = alts[alt].positions;
             let re = new RegExp(exp, "ig");
 
             while ((res = re.exec(this.email)) != null) {
                 if (!this.limitNums(res, this.email) && !this.limitChars(res, this.email)) {
--- a/calendar/base/modules/calRecurrenceUtils.jsm
+++ b/calendar/base/modules/calRecurrenceUtils.jsm
@@ -337,34 +337,34 @@ function recurrenceRule2String(recurrenc
                 }
             } else {
                 if (rule.isFinite) {
                     if (rule.isByCount) {
                         let countString = getRString("repeatCount",
                             [ruleString,
                              dateFormatter.formatDateShort(startDate),
                              dateFormatter.formatTime(startDate),
-                             dateFormatter.formatTime(endDate) ]);
+                             dateFormatter.formatTime(endDate)]);
                         detailsString = PluralForm.get(rule.count, countString)
                                                   .replace("#5", rule.count);
                     } else {
                         let untilDate = rule.untilDate.getInTimezone(kDefaultTimezone);
                         detailsString = getRString("repeatDetailsUntil",
                             [ruleString,
                              dateFormatter.formatDateShort(startDate),
                              dateFormatter.formatDateShort(untilDate),
                              dateFormatter.formatTime(startDate),
                              dateFormatter.formatTime(endDate)]);
                     }
                 } else {
                     detailsString = getRString("repeatDetailsInfinite",
                         [ruleString,
                          dateFormatter.formatDateShort(startDate),
                          dateFormatter.formatTime(startDate),
-                         dateFormatter.formatTime(endDate) ]);
+                         dateFormatter.formatTime(endDate)]);
                 }
             }
             return detailsString;
         }
     }
     return null;
 }
 
--- a/calendar/base/modules/calUtils.jsm
+++ b/calendar/base/modules/calUtils.jsm
@@ -591,17 +591,17 @@ var cal = {
         case "categories":
           return aItem.getCategories({}).join(", ");
 
         case "location":
           return aItem.getProperty("LOCATION") || "";
 
         case "status":
           if (cal.isToDo(aItem)) {
-            return ["NEEDS-ACTION", "IN-PROCESS", "COMPLETED", "CANCELLED" ].indexOf(aItem.status);
+            return ["NEEDS-ACTION", "IN-PROCESS", "COMPLETED", "CANCELLED"].indexOf(aItem.status);
           } else {
             return ["TENTATIVE", "CONFIRMED", "CANCELLED"].indexOf(aItem.status);
           }
         case "calendar":
           return aItem.calendar.name || "";
 
         default:
           return null;
--- a/calendar/base/src/calAlarm.js
+++ b/calendar/base/src/calAlarm.js
@@ -459,16 +459,17 @@ calAlarm.prototype = {
         // Set up lastAck
         if (this.lastAck) {
             let lastAckProp = icssvc.createIcalProperty("X-MOZ-LASTACK");
             lastAckProp.value = this.lastAck;
             comp.addProperty(lastAckProp);
         }
 
         // Set up X-Props. mProperties contains only non-promoted props
+        // eslint-disable-next-line array-bracket-spacing
         for (let [propName, ] of this.mProperties) {
             let icalprop = icssvc.createIcalProperty(propName);
             icalprop.value = this.mProperties.getProperty(propName);
 
             // Add parameters
             let propBucket = this.mPropertyParams[propName];
             if (propBucket) {
                 for (let paramName in propBucket) {
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -864,26 +864,28 @@ calMgrCalendarObserver.prototype = {
             // restart Thunderbird and making sure a new Id is used.
             this.calMgr.removeCalendar(aCalendar, cICM.REMOVE_NO_DELETE);
             let newCal = this.calMgr.createCalendar(aCalendar.type, aCalendar.uri);
             newCal.name = aCalendar.name;
 
             // TODO: if properties get added this list will need to be adjusted,
             // ideally we should add a "getProperties" method to calICalendar.idl
             // to retrieve all non-transient properties for a calendar.
-            let propsToCopy = [ "color",
-                                "disabled",
-                                "auto-enabled",
-                                "cache.enabled",
-                                "refreshInterval",
-                                "suppressAlarms",
-                                "calendar-main-in-composite",
-                                "calendar-main-default",
-                                "readOnly",
-                                "imip.identity.key"];
+            let propsToCopy = [
+                "color",
+                "disabled",
+                "auto-enabled",
+                "cache.enabled",
+                "refreshInterval",
+                "suppressAlarms",
+                "calendar-main-in-composite",
+                "calendar-main-default",
+                "readOnly",
+                "imip.identity.key"
+            ];
             for (let prop of propsToCopy) {
               newCal.setProperty(prop,
                                  aCalendar.getProperty(prop));
             }
 
             if (initialSortOrderPos != null) {
                 newCal.setProperty("initialSortOrderPos",
                                    initialSortOrderPos);
--- a/calendar/base/src/calUtils.js
+++ b/calendar/base/src/calUtils.js
@@ -1695,18 +1695,18 @@ function calIterateEmailIdentities(func)
  * @param aSecondItem       The item to compare to.
  * @param aIgnoreProps      (optional) An array of parameters to ignore.
  * @param aIgnoreParams     (optional) An object describing which parameters to
  *                                     ignore.
  * @return                  True, if items match.
  */
 function compareItemContent(aFirstItem, aSecondItem, aIgnoreProps, aIgnoreParams) {
     let ignoreProps = arr2hash(aIgnoreProps ||
-        [ "X-MOZ-GENERATION", "SEQUENCE", "DTSTAMP",
-          "LAST-MODIFIED", "X-MOZ-SEND-INVITATIONS" ]);
+        ["X-MOZ-GENERATION", "SEQUENCE", "DTSTAMP",
+         "LAST-MODIFIED", "X-MOZ-SEND-INVITATIONS"]);
 
     let ignoreParams = aIgnoreParams ||
         { "ATTENDEE": ["CN"], "ORGANIZER": ["CN"] };
     for (let x in ignoreParams) {
         ignoreParams[x] = arr2hash(ignoreParams[x]);
     }
 
     function arr2hash(arr) {
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -186,17 +186,17 @@ calDavCalendar.prototype = {
                 }
             } finally {
                 this.mOfflineStorage.endBatch();
             }
         }
     },
 
     get offlineCachedProperties() {
-        return [ "mAuthScheme", "mAuthRealm", "mHasWebdavSyncSupport",
+        return ["mAuthScheme", "mAuthRealm", "mHasWebdavSyncSupport",
                 "mCtag", "mWebdavSyncToken", "mSupportedItemTypes",
                 "mPrincipalUrl", "mCalHomeSet",
                 "mShouldPollInbox", "hasAutoScheduling", "mHaveScheduling",
                 "mCalendarUserAddress", "mOutboxUrl", "hasFreeBusy"];
     },
 
     get checkedServerInfo() {
         if (Services.io.offline) {
@@ -2367,17 +2367,17 @@ calDavCalendar.prototype = {
         let props = Services.strings.createBundle("chrome://calendar/locale/calendar.properties");
         let statusString;
         try {
             statusString = props.GetStringFromName("caldavRequestStatusCodeString" + status);
         } catch (e) {
             // Fallback on generic string if no string is defined for the status code
             statusString = props.GetStringFromName("caldavRequestStatusCodeStringGeneric");
         }
-        return props.formatStringFromName("caldavRequestStatusCode", [ status ], 1) + ", " +
+        return props.formatStringFromName("caldavRequestStatusCode", [status], 1) + ", " +
                statusString + "\n\n" +
                (extraInfo ? extraInfo : "");
     },
 
     //
     // calIFreeBusyProvider interface
     //
 
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -772,17 +772,17 @@ calStorageCalendar.prototype = {
                 expandedItems = item.recurrenceInfo.getOccurrences(aRangeStart, aRangeEnd, 0, {});
                 if (wantUnrespondedInvitations) {
                     expandedItems = expandedItems.filter(checkUnrespondedInvitation);
                 }
             } else if ((!wantUnrespondedInvitations || checkUnrespondedInvitation(item)) &&
                        checkIfInRange(item, aRangeStart, aRangeEnd)) {
                 // If no occurrences are wanted, check only the parent item.
                 // This will be changed with bug 416975.
-                expandedItems = [ item ];
+                expandedItems = [item];
             }
 
             if (expandedItems.length && optionalFilterFunc) {
                 expandedItems = expandedItems.filter(optionalFilterFunc);
             }
 
             queueItems(expandedItems, theIID);
             return expandedItems.length;
@@ -1386,20 +1386,20 @@ calStorageCalendar.prototype = {
             this.mDeleteMetaData = this.mDB.createStatement(
                 "DELETE FROM cal_metadata WHERE item_id = :item_id AND cal_id = :cal_id"
                 );
             this.mDeleteAlarms = this.mDB.createStatement(
                 "DELETE FROM cal_alarms WHERE item_id = :item_id AND cal_id = :cal_id"
                 );
 
             // These are only used when deleting an entire calendar
-            let extrasTables = [ "cal_attendees", "cal_properties",
-                                 "cal_recurrence", "cal_attachments",
-                                 "cal_metadata", "cal_relations",
-                                 "cal_alarms"];
+            let extrasTables = ["cal_attendees", "cal_properties",
+                                "cal_recurrence", "cal_attachments",
+                                "cal_metadata", "cal_relations",
+                                "cal_alarms"];
 
             this.mDeleteEventExtras = [];
             this.mDeleteTodoExtras = [];
 
             for (let table in extrasTables) {
                 this.mDeleteEventExtras[table] = this.mDB.createStatement(
                     "DELETE FROM " + extrasTables[table] + " WHERE item_id IN" +
                     "  (SELECT id FROM cal_events WHERE cal_id = :cal_id)" +
--- a/calendar/providers/wcap/calWcapSession.js
+++ b/calendar/providers/wcap/calWcapSession.js
@@ -64,16 +64,17 @@ function getWcapSessionFor(calendar, uri
             if (regCal.isDefaultCalendar) {
                 defaultCal = regCal;
                 break;
             }
         }
 
         if (defaultCal) {
             session.defaultCalendar = defaultCal;
+            // eslint-disable-next-line array-bracket-spacing
             let [defaultSpec, ] = splitUriParams(defaultCal.uri);
             session.uri = cal.makeURL(defaultSpec);
             session.credentials.userId = defaultCal.getProperty("user_id");
             log("default calendar found.", defaultCal);
 
             // check and fix changing urls (autoconf) of subscribed calendars here:
             for (let regCal of registeredCalendars) {
                 if (!regCal.isDefaultCalendar) {
--- a/calendar/resources/content/calendarCreation.js
+++ b/calendar/resources/content/calendarCreation.js
@@ -106,17 +106,18 @@ function checkRequired() {
     if (curPage) {
         let eList = curPage.getElementsByAttribute('required', 'true');
         for (let i = 0; i < eList.length && canAdvance; ++i) {
             canAdvance = (eList[i].value != "");
         }
 
         let notificationbox = document.getElementById("location-notifications");
         if (canAdvance && document.getElementById("calendar-uri").value &&
-                curPage.pageid == "locationPage") {
+                curPage. pageid == "locationPage") {
+            // eslint-disable-next-line array-bracket-spacing
             let [reason, ] = parseUri(document.getElementById("calendar-uri").value);
             canAdvance = (reason == errorConstants.SUCCESS);
             setNotification(reason);
         } else {
             notificationbox.removeAllNotifications();
         }
         document.getElementById('calendar-wizard').canAdvance = canAdvance;
     }
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -362,16 +362,17 @@ GDataServer.prototype = {
         } else if (matchTag) {
             response.setStatusLine(null, 412, "Precondition Failed");
         } else {
             response.setStatusLine(null, 404, "Not Found");
         }
     },
 
     handleDelete: function(request, response, items, itemId) {
+        // eslint-disable-next-line array-bracket-spacing
         let [foundIndex, ] = findKey(items, "id", itemId);
 
         let matchTag = request.hasHeader("If-Match") ?
                        request.getHeader("If-Match") : null;
 
         if (foundIndex != -1) {
             if (!matchTag || matchTag == "*" || items[foundIndex].etag == matchTag) {
                 items.splice(foundIndex, 1);
--- a/calendar/test/unit/test_providers.js
+++ b/calendar/test/unit/test_providers.js
@@ -190,51 +190,51 @@ var icalStringArray = [
                 "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().
-    let wantedArray = [[ 1, 1],
-                       [ 2, 1],
-                       [ 3, 1],
-                       [ 5, 0],
-                       [ 6, 1],
-                       [ 7, 1],
-                       [ 8, 0],
-                       [ 9, 1],
-                       [ 10, 0],
-                       [ 11, 0],
-                       [ 12, 1],
-                       [ 13, 1],
-                       [ 14, 0],
-                       [ 15, 1],
-                       [ 16, 1],
-                       [ 17, 1],
-                       [ 18, 1],
-                       [ 19, 1],
-                       [ 20, 1],
-                       [ 21, 0],
-                       [ 22, 0],
-                       [ 23, 1],
-                       [ 24, 1],
-                       [ 25, 1],
-                       [ 26, 1],
-                       [ 27, 1],
-                       [ 28, 0],
-                       [ 29, 1],
-                       [ 30, 1],
-                       [ 31, 0],
-                       [ 32, 0],
-                       [ 33, 1],
-                       [ 34, 1],
-                       [ 35, 0],
-                       [ 36, 0]];
+    let wantedArray = [[1, 1],
+                       [2, 1],
+                       [3, 1],
+                       [5, 0],
+                       [6, 1],
+                       [7, 1],
+                       [8, 0],
+                       [9, 1],
+                       [10, 0],
+                       [11, 0],
+                       [12, 1],
+                       [13, 1],
+                       [14, 0],
+                       [15, 1],
+                       [16, 1],
+                       [17, 1],
+                       [18, 1],
+                       [19, 1],
+                       [20, 1],
+                       [21, 0],
+                       [22, 0],
+                       [23, 1],
+                       [24, 1],
+                       [25, 1],
+                       [26, 1],
+                       [27, 1],
+                       [28, 0],
+                       [29, 1],
+                       [30, 1],
+                       [31, 0],
+                       [32, 0],
+                       [33, 1],
+                       [34, 1],
+                       [35, 0],
+                       [36, 0]];
 
     for (let i = 0; i < wantedArray.length; i++) {
         let itemArray = wantedArray[i];
         // Correct for 1 to stay in synch with test numbers.
         let calItem = icalStringArray[itemArray[0] - 1];
 
         let item;
         if (calItem.search(/VEVENT/) != -1) {