Bug 1280898 - Set up eslint for calendar files - enable var-only-toplevel rule. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Fri, 08 Jul 2016 11:19:29 +0200
changeset 25973 7063147fed66249f88739ba93466bd58a7ff032f
parent 25972 fd02e757b1420b415cd3df380922d350c3dbefb6
child 25974 377282fc615d97ac51cdc94ed1f52f8e7cc702f1
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 var-only-toplevel rule. r=MakeMyDay MozReview-Commit-ID: 9gQOq7o6PFJ
calendar/.eslintrc
calendar/base/backend/icaljs/calICSService.js
calendar/base/content/agenda-listbox.js
calendar/base/content/agenda-listbox.xml
calendar/base/content/calendar-base-view.xml
calendar/base/content/calendar-common-sets.js
calendar/base/content/calendar-daypicker.xml
calendar/base/content/calendar-invitations-manager.js
calendar/base/content/calendar-item-editing.js
calendar/base/content/calendar-menus.xml
calendar/base/content/calendar-month-view.xml
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-statusbar.js
calendar/base/content/calendar-task-editing.js
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-ui-utils.js
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-view-core.xml
calendar/base/content/calendar-views.js
calendar/base/content/calendar-views.xml
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-timezone.js
calendar/base/content/dialogs/calendar-invitations-dialog.js
calendar/base/content/dialogs/calendar-invitations-list.xml
calendar/base/content/dialogs/calendar-print-dialog.js
calendar/base/content/dialogs/calendar-subscriptions-dialog.js
calendar/base/content/dialogs/calendar-summary-dialog.js
calendar/base/content/import-export.js
calendar/base/content/preferences/alarms.js
calendar/base/content/preferences/categories.js
calendar/base/content/preferences/general.js
calendar/base/content/preferences/views.js
calendar/base/content/widgets/calendar-list-tree.xml
calendar/base/content/widgets/calendar-subscriptions-list.xml
calendar/base/content/widgets/calendar-widgets.xml
calendar/base/content/widgets/minimonth.xml
calendar/base/modules/calAlarmUtils.jsm
calendar/base/modules/calAuthUtils.jsm
calendar/base/modules/calProviderUtils.jsm
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/modules/calUtils.jsm
calendar/base/src/calAttendee.js
calendar/base/src/calCachedCalendar.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calCalendarSearchService.js
calendar/base/src/calDateTimeFormatter.js
calendar/base/src/calEvent.js
calendar/base/src/calFreeBusyService.js
calendar/base/src/calItemBase.js
calendar/base/src/calProtocolHandler.js
calendar/base/src/calRecurrenceInfo.js
calendar/base/src/calTimezone.js
calendar/base/src/calTimezoneService.js
calendar/base/src/calTodo.js
calendar/base/src/calTransactionManager.js
calendar/base/src/calUtils.js
calendar/base/src/calWeekInfoService.js
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/content/lightning-utils.js
calendar/lightning/content/messenger-overlay-preferences.js
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/providers/caldav/calDavCalendar.js
calendar/providers/ics/calICSCalendar.js
calendar/providers/memory/calMemoryCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/wcap/calWcapCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/providers/wcap/calWcapErrors.js
calendar/providers/wcap/calWcapRequest.js
calendar/providers/wcap/calWcapSession.js
calendar/providers/wcap/calWcapUtils.js
calendar/resources/content/datetimepickers/datetimepickers.xml
calendar/resources/content/mouseoverPreviews.js
calendar/resources/content/publish.js
calendar/resources/content/publishDialog.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/recurrenceRotated/testAnnualRecurrence.js
calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
calendar/test/unit/head_consts.js
calendar/test/unit/test_attendee.js
calendar/test/unit/test_freebusy.js
calendar/test/unit/test_ics.js
calendar/test/unit/test_providers.js
calendar/test/unit/test_recur.js
calendar/test/unit/test_timezone.js
--- a/calendar/.eslintrc
+++ b/calendar/.eslintrc
@@ -195,16 +195,21 @@
 
     // Warn about declaration of variables already declared in the outer scope.
     // This isn't an error because it sometimes is useful to use the same name
     // in a small helper function rather than having to come up with another
     // random name.  Still, making this a warning can help people avoid being
     // confused.
     "no-shadow": 2,
 
+    // We use var-only-at-top-level instead of no-var as we allow top level
+    // vars.
+    "no-var": 0,
+    "mozilla/var-only-at-top-level": 1,
+
     // Will enable these rules later
     "block-spacing": 0,
     "no-lonely-if": 0,
     "space-before-blocks": 0,
     "computed-property-spacing": 0,
     "consistent-return": 0,
 
     // The following rules will not be enabled currently, but are kept here for
--- a/calendar/base/backend/icaljs/calICSService.js
+++ b/calendar/base/backend/icaljs/calICSService.js
@@ -363,23 +363,23 @@ calIcalComponent.prototype = {
             kind = kind.toLowerCase();
         }
         let innerObject = this.innerObject;
         this.propertyIterator = (function* () {
             let props = innerObject.getAllProperties(kind);
             if (!props) {
                 return;
             }
-            for (var prop of props) {
+            for (let prop of props) {
                 let hell = prop.getValues();
                 if (hell.length > 1) {
                     // Uh oh, multiple property values. Our code expects each as one
                     // property. I hate API incompatibility!
-                    for (var devil of hell) {
-                        var thisprop = new ICAL.Property(prop.toJSON(),
+                    for (let devil of hell) {
+                        let thisprop = new ICAL.Property(prop.toJSON(),
                                                          prop.parent);
                         thisprop.removeAllValues();
                         thisprop.setValue(devil);
                         yield new calIcalProperty(thisprop);
                     }
                 } else {
                     yield new calIcalProperty(prop);
                 }
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -22,41 +22,41 @@ var agendaListbox = {
 
 /**
  * Initialize the agenda listbox, used on window load.
  */
 agendaListbox.init =
 function initAgendaListbox() {
     this.agendaListboxControl = document.getElementById("agenda-listbox");
     this.agendaListboxControl.removeAttribute("suppressonselect");
-    var showTodayHeader = (document.getElementById("today-header-hidden").getAttribute("checked") == "true");
-    var showTomorrowHeader = (document.getElementById("tomorrow-header-hidden").getAttribute("checked") == "true");
-    var showSoonHeader = (document.getElementById("nextweek-header-hidden").getAttribute("checked") == "true");
+    let showTodayHeader = (document.getElementById("today-header-hidden").getAttribute("checked") == "true");
+    let showTomorrowHeader = (document.getElementById("tomorrow-header-hidden").getAttribute("checked") == "true");
+    let showSoonHeader = (document.getElementById("nextweek-header-hidden").getAttribute("checked") == "true");
     this.today = new Synthetic(showTodayHeader, 1, false);
     this.addPeriodListItem(this.today, "today-header");
     this.tomorrow = new Synthetic(showTomorrowHeader, 1, false);
     this.soonDays = getSoondaysPreference();
     this.soon = new Synthetic(showSoonHeader, this.soonDays, true);
     this.periods = [this.today, this.tomorrow, this.soon];
     this.mPendingRefreshJobs = new Map();
 
-    var prefObserver = {
+    let prefObserver = {
         observe: function aL_observe(aSubject, aTopic, aPrefName) {
             switch (aPrefName) {
                 case "calendar.agendaListbox.soondays":
                     agendaListbox.soonDays = getSoondaysPreference();
                     agendaListbox.updateSoonSection();
                     break;
             }
         }
     };
     Services.prefs.addObserver("calendar.agendaListbox", prefObserver, false);
 
     // Make sure the agenda listbox is unloaded
-    var self = this;
+    let self = this;
     window.addEventListener("unload",
                             function unload_agendaListbox() {
                                 Services.prefs.removeObserver("calendar.agendaListbox", prefObserver);
                                 self.uninit();
                             },
                             false);
 };
 
@@ -64,17 +64,17 @@ function initAgendaListbox() {
  * Clean up the agenda listbox, used on window unload.
  */
 agendaListbox.uninit =
 function uninit() {
     if (this.calendar) {
         this.calendar.removeObserver(this.calendarObserver);
     }
 
-    for (var period of this.periods) {
+    for (let period of this.periods) {
         if (period.listItem) {
             period.listItem.getCheckbox()
                   .removeEventListener("CheckboxStateChange",
                                        this.onCheckboxChange,
                                        true);
         }
     }
 };
@@ -114,34 +114,34 @@ function removePeriodListItem(aPeriod) {
 
 /**
  * Handler function called when changing the checkbox state on period items.
  *
  * @param event     The DOM event that triggered the checkbox state change.
  */
 agendaListbox.onCheckboxChange =
 function onCheckboxChange(event) {
-    var periodCheckbox = event.target;
-    var lopen = (periodCheckbox.getAttribute("checked") == "true");
-    var listItem = getParentNodeOrThis(periodCheckbox, "agenda-checkbox-richlist-item");
-    var period = listItem.getItem();
+    let periodCheckbox = event.target;
+    let lopen = (periodCheckbox.getAttribute("checked") == "true");
+    let listItem = getParentNodeOrThis(periodCheckbox, "agenda-checkbox-richlist-item");
+    let 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",
                             periodCheckbox.getAttribute("checked"));
     if (lopen) {
         agendaListbox.refreshCalendarQuery(period.start, period.end);
     } else {
         listItem = listItem.nextSibling;
         let leaveloop;
         do {
             leaveloop = (listItem == null);
             if (!leaveloop) {
-                var nextItemSibling = listItem.nextSibling;
+                let nextItemSibling = listItem.nextSibling;
                 leaveloop = (!agendaListbox.isEventListItem(listItem));
                 if (!leaveloop) {
                     listItem.remove();
                     listItem = nextItemSibling;
                 }
             }
         } while (!leaveloop);
     }
@@ -181,17 +181,17 @@ function onBlur() {
 };
 
 
 /**
  * Handler function called when a key was pressed on the agenda listbox
  */
 agendaListbox.onKeyPress =
 function onKeyPress(aEvent) {
-    var listItem = aEvent.target;
+    let listItem = aEvent.target;
     if (listItem.localName == "richlistbox") {
         listItem = listItem.selectedItem;
     }
     switch (aEvent.keyCode) {
         case aEvent.DOM_VK_RETURN:
             document.getElementById('agenda_edit_event_command').doCommand();
             break;
         case aEvent.DOM_VK_DELETE:
@@ -212,63 +212,63 @@ function onKeyPress(aEvent) {
     }
 };
 
 /**
  * Calls the event dialog to edit the currently selected item
  */
 agendaListbox.editSelectedItem =
 function editSelectedItem() {
-    var listItem = document.getElementById("agenda-listbox").selectedItem;
+    let listItem = document.getElementById("agenda-listbox").selectedItem;
     if (listItem) {
         modifyEventWithDialog(listItem.occurrence, null, true);
     }
 };
 
 /**
  * Finds the appropriate period for the given item, i.e finds "Tomorrow" if the
  * item occurrs tomorrow.
  *
  * @param aItem     The item to find the period for.
  */
 agendaListbox.findPeriodsForItem =
 function findPeriodsForItem(aItem) {
-    var retPeriods = [];
-    for (var i = 0; i < this.periods.length; i++) {
+    let retPeriods = [];
+    for (let i = 0; i < this.periods.length; i++) {
         if (this.periods[i].open) {
             if (checkIfInRange(aItem, this.periods[i].start, this.periods[i].end)) {
                 retPeriods.push(this.periods[i]);
             }
         }
     }
     return retPeriods;
 };
 
 /**
  * Gets the start of the earliest period shown in the agenda listbox
  */
 agendaListbox.getStart =
 function getStart(){
-    var retStart = null;
-    for (var i = 0; i < this.periods.length; i++) {
+    let retStart = null;
+    for (let i = 0; i < this.periods.length; i++) {
         if (this.periods[i].open) {
             retStart = this.periods[i].start;
             break;
         }
     }
     return retStart;
 };
 
 /**
  * Gets the end of the latest period shown in the agenda listbox
  */
 agendaListbox.getEnd =
 function getEnd(){
-    var retEnd = null;
-    for (var i = this.periods.length - 1; i >= 0; i--) {
+    let retEnd = null;
+    for (let i = this.periods.length - 1; i >= 0; i--) {
         if (this.periods[i].open) {
             retEnd = this.periods[i].end;
             break;
         }
     }
     return retEnd;
 };
 
@@ -278,17 +278,17 @@ function getEnd(){
  * @param aNewItem      The calIItemBase to add.
  * @param aAgendaItem   The existing item to insert before.
  * @param aPeriod       The period to add the item to.
  * @param visible       If true, the item should be visible.
  * @return              The newly created XUL element.
  */
 agendaListbox.addItemBefore =
 function addItemBefore(aNewItem, aAgendaItem, aPeriod, visible) {
-    var newelement = null;
+    let newelement = null;
     if (aNewItem.startDate.isDate) {
         newelement = createXULElement("agenda-allday-richlist-item");
     } else {
         newelement = createXULElement("agenda-richlist-item");
     }
     // set the item at the richlistItem. When the duration of the period
     // is bigger than 1 (day) the starttime of the item has to include
     // information about the day of the item
@@ -309,37 +309,37 @@ function addItemBefore(aNewItem, aAgenda
  * @param aItem         The calIItemBase to add.
  * @return              The newly created XUL element.
  */
 agendaListbox.addItem =
 function addItem(aItem) {
     if (!isEvent(aItem)) {
         return null;
     }
-    var periods = this.findPeriodsForItem(aItem);
+    let periods = this.findPeriodsForItem(aItem);
     if (periods.length == 0) {
         return null;
     }
     let newlistItem = null;
-    for (var i = 0; i < periods.length; i++) {
+    for (let i = 0; i < periods.length; i++) {
         let period = periods[i];
         let complistItem = period.listItem;
         let visible = complistItem.getCheckbox().checked;
         if (aItem.startDate.isDate && period.duration == 1 && aItem.duration.days == 1) {
             if (this.getListItems(aItem, period).length == 0) {
                 this.addItemBefore(aItem, period.listItem.nextSibling, period, visible);
             }
         } else {
             do {
                 complistItem = complistItem.nextSibling;
                 if (!this.isEventListItem(complistItem)) {
                     newlistItem = this.addItemBefore(aItem, complistItem, period, visible);
                     break;
                 } else {
-                    var compitem = complistItem.occurrence;
+                    let compitem = complistItem.occurrence;
                     if (this.isSameEvent(aItem, compitem)) {
                         // The same event occurs on several calendars but we only
                         // display the first one.
                         // TODO: find a way to display this special circumstance
                         break;
                     } else if (this.isBefore(aItem, compitem, period)) {
                         if (this.isSameEvent(aItem, compitem)) {
                             newlistItem = this.addItemBefore(aItem, complistItem, period, visible);
@@ -453,23 +453,23 @@ function comparisonDate(aItem, aPeriod) 
  * Gets the listitems for a given item, possibly in a given period.
  *
  * @param aItem         The item to get the list items for.
  * @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 = [];
-    var periods = [aPeriod];
+    let retlistItems = [];
+    let periods = [aPeriod];
     if (!aPeriod) {
         periods = this.findPeriodsForItem(aItem);
     }
     if (periods.length > 0) {
-        for (var i = 0; i < periods.length; i++) {
+        for (let i = 0; i < periods.length; i++) {
             let period = periods[i];
             let complistItem = period.listItem;
             let leaveloop;
             do {
                 complistItem = complistItem.nextSibling;
                 leaveloop = (!this.isEventListItem(complistItem));
                 if (!leaveloop) {
                     if (this.isSameEvent(aItem, complistItem.occurrence)){
@@ -488,22 +488,22 @@ function getListItems(aItem, aPeriod) {
  *
  * @param aItem             The item to remove.
  * @param aMoveSelection    If true, the selection will be moved to the next
  *                            sibling that is not an period item.
  * @return                  Returns true if the removed item was selected.
  */
 agendaListbox.deleteItem =
 function deleteItem(aItem, aMoveSelection) {
-    var isSelected = false;
-    var listItems = this.getListItems(aItem);
+    let isSelected = false;
+    let listItems = this.getListItems(aItem);
     if (listItems.length > 0) {
-        for (var i = listItems.length - 1; i >= 0; i--) {
-            var listItem = listItems[i];
-            var isSelected2 = listItem.selected;
+        for (let i = listItems.length - 1; i >= 0; i--) {
+            let listItem = listItems[i];
+            let isSelected2 = listItem.selected;
             if (isSelected2 && !isSelected) {
                 isSelected = true;
                 if (aMoveSelection) {
                     this.moveSelection();
                 }
             }
             listItem.remove();
         }
@@ -544,33 +544,33 @@ function isSameEvent(aItem, aCompItem) {
 /**
  * Checks if the currently selected node in the listbox is an Event item (not a
  * period item).
  *
  * @return              True, if the node is not a period item.
  */
 agendaListbox.isEventSelected =
 function isEventSelected() {
-    var listItem = this.agendaListboxControl.selectedItem;
+    let listItem = this.agendaListboxControl.selectedItem;
     if (listItem) {
         return (this.isEventListItem(listItem));
     }
     return false;
 };
 
 /**
  * Delete the selected item from its calendar (if it is an event item)
  *
  * @param aDoNotConfirm     If true, the user will not be prompted.
  */
 agendaListbox.deleteSelectedItem =
 function deleteSelectedItem(aDoNotConfirm) {
-    var listItem = this.agendaListboxControl.selectedItem;
+    let listItem = this.agendaListboxControl.selectedItem;
     if (this.isEventListItem(listItem)) {
-        var selectedItems = [listItem.occurrence];
+        let selectedItems = [listItem.occurrence];
         calendarViewController.deleteOccurrences(selectedItems.length,
                                                  selectedItems,
                                                  false,
                                                  aDoNotConfirm);
     }
 };
 
 /**
@@ -579,17 +579,17 @@ function deleteSelectedItem(aDoNotConfir
  *
  * @param aEvent            The DOM event that targets the period.
  */
 agendaListbox.createNewEvent =
 function createNewEvent(aEvent) {
     if (!this.isEventListItem(aEvent.target)){
         // Create new event for the date currently displayed in the agenda. Setting
         // isDate = true automatically makes the start time be the next full hour.
-        var eventStart = agendaListbox.today.start.clone();
+        let eventStart = agendaListbox.today.start.clone();
         eventStart.isDate = true;
         if (calendarController.isCommandEnabled("calendar_new_event_command")) {
             createEventWithDialog(getSelectedCalendar(), eventStart);
         }
     }
 };
 
 /**
@@ -734,28 +734,28 @@ function setupCalendar() {
  * @see #refreshCalendarQuery
  * @param newDate       The first date to show if the agenda pane doesn't show
  *                        today.
  */
 agendaListbox.refreshPeriodDates =
 function refreshPeriodDates(newDate) {
      this.kDefaultTimezone = calendarDefaultTimezone();
     // Today: now until midnight of tonight
-    var oldshowstoday = this.showstoday;
+    let oldshowstoday = this.showstoday;
     this.showstoday = this.showsToday(newDate);
     if ((this.showstoday) && (!oldshowstoday)) {
         this.addPeriodListItem(this.tomorrow, "tomorrow-header");
         this.addPeriodListItem(this.soon, "nextweek-header");
     } else if (!this.showstoday) {
         this.removePeriodListItem(this.tomorrow);
         this.removePeriodListItem(this.soon);
     }
     newDate.isDate = true;
-    for (var i = 0; i < this.periods.length; i++) {
-        var curPeriod = this.periods[i];
+    for (let i = 0; i < this.periods.length; i++) {
+        let curPeriod = this.periods[i];
         newDate.hour = newDate.minute = newDate.second = 0;
         if (i == 0 && this.showstoday) {
             curPeriod.start = now();
         } else {
             curPeriod.start = newDate.clone();
         }
         newDate.day += curPeriod.duration;
         curPeriod.end = newDate.clone();
@@ -778,53 +778,53 @@ function addListener(aListener) {
  * Checks if the agenda listbox is showing "today". Without arguments, this
  * function assumes the today attribute of the agenda listbox.
  *
  * @param aStartDate    (optional) The day to check if its "today".
  * @return              Returns true if today is shown.
  */
 agendaListbox.showsToday =
 function showsToday(aStartDate) {
-    var lstart = aStartDate;
+    let lstart = aStartDate;
     if (!lstart) {
         lstart = this.today.start;
     }
-    var lshowsToday = (sameDay(now(), lstart));
+    let lshowsToday = (sameDay(now(), lstart));
     if (lshowsToday) {
         this.periods = [this.today, this.tomorrow, this.soon];
     } else {
         this.periods = [this.today];
     }
     return lshowsToday;
 };
 
 /**
  * Moves the selection. Moves down unless the next item is a period item, in
  * which case the selection moves up.
  */
 agendaListbox.moveSelection =
 function moveSelection() {
-    var selindex = this.agendaListboxControl.selectedIndex;
+    let selindex = this.agendaListboxControl.selectedIndex;
     if (!this.isEventListItem(this.agendaListboxControl.selectedItem.nextSibling)) {
         this.agendaListboxControl.goUp();
     } else {
         this.agendaListboxControl.goDown();
     }
 };
 
 /**
  * Gets an array of selected items. If a period node is selected, it is not
  * included.
  *
  * @return      An array with all selected items.
  */
 agendaListbox.getSelectedItems =
 function getSelectedItems() {
-    var selindex = this.agendaListboxControl.selectedIndex;
-    var items = [];
+    let selindex = this.agendaListboxControl.selectedIndex;
+    let items = [];
     if (this.isEventListItem(this.agendaListboxControl.selectedItem)) {
         // If at some point we support selecting multiple items, this array can
         // be expanded.
         items = [this.agendaListboxControl.selectedItem.occurrence];
     }
     return items;
 };
 
@@ -832,35 +832,35 @@ function getSelectedItems() {
  * Checks if the passed node in the listbox is an Event item (not a
  * period item).
  *
  * @param aListItem     The node to check for.
  * @return              True, if the node is not a period item.
  */
 agendaListbox.isEventListItem =
 function isEventListItem(aListItem) {
-    var isListItem = (aListItem != null);
+    let isListItem = (aListItem != null);
     if (isListItem) {
-        var localName = aListItem.localName;
+        let localName = aListItem.localName;
         isListItem = (localName == "agenda-richlist-item" ||
                       localName == "agenda-allday-richlist-item");
     }
     return isListItem;
 };
 
 /**
  * Removes all Event items, keeping the period items intact.
  */
 agendaListbox.removeListItems =
 function removeListItems() {
-    var listItem = this.agendaListboxControl.lastChild;
+    let listItem = this.agendaListboxControl.lastChild;
     if (listItem) {
-        var leaveloop = false;
+        let leaveloop = false;
         do {
-            var newlistItem = null;
+            let newlistItem = null;
             if (listItem) {
                 newlistItem = listItem.previousSibling;
             } else {
                 leaveloop = true;
             }
             if (this.isEventListItem(listItem)) {
                 if (listItem != this.agendaListboxControl.firstChild) {
                     listItem.remove();
@@ -875,18 +875,18 @@ function removeListItems() {
 
 /**
  * Gets the list item node by its associated event's hashId.
  *
  * @return The XUL node if successful, otherwise null.
  */
 agendaListbox.getListItemByHashId =
 function getListItemByHashId(ahashId) {
-    var listItem = this.agendaListboxControl.firstChild;
-    var leaveloop = false;
+    let listItem = this.agendaListboxControl.firstChild;
+    let leaveloop = false;
     do {
         if (this.isEventListItem(listItem)) {
             if (listItem.occurrence.hashId == ahashId) {
                 return listItem;
             }
         }
         listItem = listItem.nextSibling;
         leaveloop = (listItem == null);
@@ -933,63 +933,63 @@ agendaListbox.calendarObserver.onLoad = 
     this.agendaListbox.refreshCalendarQuery();
 };
 
 agendaListbox.calendarObserver.onAddItem = function observer_onAddItem(item) {
     if (!isEvent(item)) {
         return;
     }
     // get all sub items if it is a recurring item
-    var occs = this.getOccurrencesBetween(item);
+    let occs = this.getOccurrencesBetween(item);
     occs.forEach(this.agendaListbox.addItem, this.agendaListbox);
     setCurrentEvent();
 };
 
 agendaListbox.calendarObserver.getOccurrencesBetween =
 function getOccurrencesBetween(aItem) {
-    var occs = [];
-    var start = this.agendaListbox.getStart();
-    var end = this.agendaListbox.getEnd();
+    let occs = [];
+    let start = this.agendaListbox.getStart();
+    let end = this.agendaListbox.getEnd();
     if (start && end) {
         occs = aItem.getOccurrencesBetween(start, end, {});
     }
     return occs;
 };
 
 agendaListbox.calendarObserver.onDeleteItem =
 function observer_onDeleteItem(item, rebuildFlag) {
     this.onLocalDeleteItem(item, true);
 };
 
 agendaListbox.calendarObserver.onLocalDeleteItem =
 function observer_onLocalDeleteItem(item, moveSelection) {
     if (!isEvent(item)) {
         return false;
     }
-    var selectedItemHashId = -1;
+    let selectedItemHashId = -1;
 // get all sub items if it is a recurring item
-    var occs = this.getOccurrencesBetween(item);
-    for (var i = 0; i < occs.length; i++) {
-        var isSelected = this.agendaListbox.deleteItem(occs[i], moveSelection);
+    let occs = this.getOccurrencesBetween(item);
+    for (let i = 0; i < occs.length; i++) {
+        let isSelected = this.agendaListbox.deleteItem(occs[i], moveSelection);
         if (isSelected) {
             selectedItemHashId = occs[i].hashId;
         }
     }
     return selectedItemHashId;
 };
 
 agendaListbox.calendarObserver.onModifyItem =
 function observer_onModifyItem(newItem, oldItem) {
-    var selectedItemHashId = this.onLocalDeleteItem(oldItem, false);
+    let selectedItemHashId = this.onLocalDeleteItem(oldItem, false);
     if (!isEvent(newItem)) {
         return;
     }
     this.onAddItem(newItem);
     if (selectedItemHashId != -1) {
-        var listItem = agendaListbox.getListItemByHashId(selectedItemHashId);
+        let listItem = agendaListbox.getListItemByHashId(selectedItemHashId);
         if (listItem) {
             agendaListbox.agendaListboxControl.clearSelection();
             agendaListbox.agendaListboxControl.ensureElementIsVisible(listItem);
             agendaListbox.agendaListboxControl.selectedItem = listItem;
         }
     }
     setCurrentEvent();
 };
@@ -997,17 +997,17 @@ function observer_onModifyItem(newItem, 
 agendaListbox.calendarObserver.onError = function(cal, errno, msg) {};
 
 agendaListbox.calendarObserver.onPropertyChanged = function(aCalendar, aName, aValue, aOldValue) {
     switch (aName) {
         case "disabled":
             this.agendaListbox.refreshCalendarQuery();
             break;
         case "color":
-            for (var node = agendaListbox.agendaListboxControl.firstChild;
+            for (let node = agendaListbox.agendaListboxControl.firstChild;
                  node;
                  node = node.nextSibling) {
                 // Change color on all nodes that don't do so themselves, which
                 // is currently only he agenda-richlist-item
                 if (node.localName != "agenda-richlist-item") {
                     continue;
                 }
                 node.refreshColor();
@@ -1126,25 +1126,25 @@ var gEventTimer;
  *                                current.
  * @param aMsUntil              The number of milliseconds until the next event
  *                                is current.
  */
 function scheduleNextCurrentEventUpdate(aRefreshCallback, aMsUntil) {
     // Is an nsITimer/callback extreme overkill here? Yes, but it's necessary to
     // workaround bug 291386.  If we don't, we stand a decent chance of getting
     // stuck in an infinite loop.
-    var udCallback = {
+    let udCallback = {
         notify: function(timer) {
             aRefreshCallback();
         }
     };
 
     if (!gEventTimer) {
         // Observer for wake after sleep/hibernate/standby to create new timers and refresh UI
-        var wakeObserver = {
+        let wakeObserver = {
            observe: function(aSubject, aTopic, aData) {
                if (aTopic == "wake_notification") {
                    aRefreshCallback();
                }
            }
         };
         // Add observer
         Services.obs.addObserver(wakeObserver, "wake_notification", false);
--- a/calendar/base/content/agenda-listbox.xml
+++ b/calendar/base/content/agenda-listbox.xml
@@ -263,21 +263,21 @@
             } else {
                 durationbox.textContent += " " + aItem.title;
             }
             this.refreshColor();
         ]]></body>
       </method>
       <method name="refreshColor">
         <body><![CDATA[
-            var calcolor = ((this.mOccurrence &&
+            let calcolor = ((this.mOccurrence &&
                              this.mOccurrence.calendar.getProperty("color")) ||
                             "#a8c2e1");
 
-            var imagebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-calendar-image");
+            let imagebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-calendar-image");
             imagebox.setAttribute("style", "background-color: " + calcolor + ";");
         ]]></body>
       </method>
     </implementation>
     <handlers>
       <handler event="dragstart"><![CDATA[
         invokeEventDragSession(this.mOccurrence.clone(), this);
       ]]></handler>
--- a/calendar/base/content/calendar-base-view.xml
+++ b/calendar/base/content/calendar-base-view.xml
@@ -415,17 +415,17 @@
           for (let i = 0; i < labeldayboxkids.length; i++) {
               labeldayboxkids[i].shortWeekNames = useShortNames;
           }
         ]]></body>
       </method>
 
       <method name="today">
         <body><![CDATA[
-          var d = cal.jsDateToDateTime(new Date()).getInTimezone(this.mTimezone);
+          let d = cal.jsDateToDateTime(new Date()).getInTimezone(this.mTimezone);
           d.isDate = true;
           return d;
         ]]></body>
       </method>
 
       <method name="isVisible">
         <body><![CDATA[
             return (this.nodeName == currentView().nodeName);
--- a/calendar/base/content/calendar-common-sets.js
+++ b/calendar/base/content/calendar-common-sets.js
@@ -84,17 +84,17 @@ var calendarController = {
         "calendar_in_background": true,
         "calendar_mode_calendar": true,
         "calendar_mode_task": true,
 
         "cmd_selectAll": true
     },
 
     updateCommands: function cC_updateCommands() {
-        for (var command in this.commands) {
+        for (let command in this.commands) {
             goUpdateCommand(command);
         }
     },
 
     supportsCommand: function cC_supportsCommand(aCommand) {
         if (aCommand in this.commands) {
             return true;
         }
@@ -222,17 +222,17 @@ var calendarController = {
                 }
                 break;
 
             default:
                 if (this.defaultController && !this.isCalendarInForeground()) {
                     // The delete-button demands a special handling in mail-mode
                     // as it is supposed to delete an element of the focused pane
                     if (aCommand == "cmd_delete" || aCommand == "button_delete") {
-                        var focusedElement = document.commandDispatcher.focusedElement;
+                        let focusedElement = document.commandDispatcher.focusedElement;
                         if (focusedElement) {
                             if (focusedElement.getAttribute("id") == "agenda-listbox") {
                                  return agendaListbox.isEventSelected();
                             } else if (focusedElement.className == "calendar-task-tree") {
                                  return this.writable &&
                                         this.todo_items_selected &&
                                         this.todo_items_writable;
                             }
@@ -439,28 +439,28 @@ var calendarController = {
                 return gCurrentMode && gCurrentMode == "calendar";
             case "task":
                 return gCurrentMode && gCurrentMode == "task";
         }
         return false;
     },
 
     onSelectionChanged: function cC_onSelectionChanged(aEvent) {
-        var selectedItems = aEvent.detail;
+        let selectedItems = aEvent.detail;
 
         calendarUpdateDeleteCommand(selectedItems);
         calendarController.item_selected = selectedItems && (selectedItems.length > 0);
 
         let selLength = (selectedItems === undefined ? 0 : selectedItems.length);
         let selected_events_readonly = 0;
         let selected_events_requires_network = 0;
         let selected_events_invitation = 0;
 
         if (selLength > 0) {
-            for (var item of selectedItems) {
+            for (let item of selectedItems) {
                 if (item.calendar.readOnly) {
                     selected_events_readonly++;
                 }
                 if (item.calendar.getProperty("requiresNetwork") &&
                     !item.calendar.getProperty("cache.enabled") &&
                     !item.calendar.getProperty("cache.always")) {
                     selected_events_requires_network++;
                 }
@@ -516,33 +516,33 @@ var calendarController = {
     get offline() {
         return Services.io.offline;
     },
 
     /**
      * Returns a boolean indicating if all calendars are readonly.
      */
     get all_readonly() {
-        var calMgr = getCalendarManager();
+        let calMgr = getCalendarManager();
         return (calMgr.readOnlyCalendarCount == calMgr.calendarCount);
     },
 
     /**
      * Returns a boolean indicating if all calendars are local
      */
     get no_network_calendars() {
         return (getCalendarManager().networkCalendarCount == 0);
     },
 
     /**
      * Returns a boolean indicating if there are calendars that don't require
      * network access.
      */
     get has_local_calendars() {
-        var calMgr = getCalendarManager();
+        let calMgr = getCalendarManager();
         return (calMgr.networkCalendarCount < calMgr.calendarCount);
     },
 
     /**
      * Returns a boolean indicating if there are cached calendars and thus that don't require
      * network access.
      */
     get has_cached_calendars() {
@@ -564,19 +564,19 @@ var calendarController = {
     },
 
     /**
      * Returns a boolean indicating that all local calendars are readonly
      */
     get all_local_calendars_readonly() {
         // We might want to speed this part up by keeping track of this in the
         // calendar manager.
-        var calendars = getCalendarManager().getCalendars({});
-        var count = calendars.length;
-        for (var calendar of calendars) {
+        let calendars = getCalendarManager().getCalendars({});
+        let count = calendars.length;
+        for (let calendar of calendars) {
             if (!isCalendarWritable(calendar)) {
                 count--;
             }
         }
         return (count == 0);
     },
 
     /**
@@ -589,17 +589,17 @@ var calendarController = {
                !this.selected_events_readonly &&
                (!this.offline || !this.selected_events_requires_network);
     },
 
     /**
      * Returns a boolean indicating that tasks are selected.
      */
     get todo_items_selected() {
-        var selectedTasks = getSelectedTasks();
+        let selectedTasks = getSelectedTasks();
         return (selectedTasks.length > 0);
     },
 
 
     get todo_items_invitation() {
         let selectedTasks = getSelectedTasks();
         let selected_tasks_invitation = 0;
 
@@ -619,18 +619,18 @@ var calendarController = {
         return (selectedTasks.length == selected_tasks_invitation);
     },
 
     /**
      * Returns a boolean indicating that at least one task in the selection is
      * on a calendar that is writable.
      */
     get todo_items_writable() {
-        var selectedTasks = getSelectedTasks();
-        for (var task of selectedTasks) {
+        let selectedTasks = getSelectedTasks();
+        for (let task of selectedTasks) {
             if (isCalendarWritable(task.calendar)) {
                 return true;
             }
         }
         return false;
     }
 };
 
--- a/calendar/base/content/calendar-daypicker.xml
+++ b/calendar/base/content/calendar-daypicker.xml
@@ -27,17 +27,17 @@
       </xul:hbox>
     </content>
     <implementation>
       <method name="onmodified">
         <parameter name="aEvent"/>
         <body>
           <![CDATA[
             if (aEvent.attrName == "checked") {
-                var event = document.createEvent('Events');
+                let event = document.createEvent('Events');
                 event.initEvent('select', true, true);
                 this.calendar.dispatchEvent(event);
             }
           ]]>
         </body>
       </method>
       <constructor>
         <![CDATA[
@@ -76,73 +76,73 @@
       <!--
       The weekday-picker manages an array of selected days of the week and
       the 'days' property is the interface to this array. the expected argument is
       an array containing integer elements, where each element represents a selected
       day of the week, starting with SUNDAY=1.
       -->
       <property name="days">
         <setter><![CDATA[
-          var mainbox =
+          let mainbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "mainbox");
-          var numChilds = mainbox.childNodes.length;
+          let numChilds = mainbox.childNodes.length;
           for (let i = 0; i < numChilds; i++) {
-              var child = mainbox.childNodes[i];
+              let child = mainbox.childNodes[i];
               child.removeAttribute("checked");
           }
           for (let i = 0; i < val.length; i++) {
-              var index = val[i] - 1 - this.weekStartOffset;
+              let index = val[i] - 1 - this.weekStartOffset;
               if (index < 0) {
                   index += 7;
               }
               mainbox.childNodes[index].setAttribute("checked", "true");
           }
           return val;
         ]]></setter>
         <getter><![CDATA[
-          var mainbox =
+          let mainbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "mainbox");
-          var numChilds = mainbox.childNodes.length;
-          var days = [];
-          for (var i = 0; i < numChilds; i++) {
-              var child = mainbox.childNodes[i];
+          let numChilds = mainbox.childNodes.length;
+          let days = [];
+          for (let i = 0; i < numChilds; i++) {
+              let child = mainbox.childNodes[i];
               if (child.getAttribute("checked") == "true") {
-                  var index = i + this.weekStartOffset;
+                  let index = i + this.weekStartOffset;
                   if (index >= 7) {
                       index -= 7;
                   }
                   days.push(index + 1);
               }
           }
           return days;
         ]]></getter>
       </property>
 
       <constructor><![CDATA[
         Components.utils.import("resource://gre/modules/Services.jsm");
         Components.utils.import("resource://gre/modules/Preferences.jsm");
 
         this.weekStartOffset = Preferences.get("calendar.week.start", 0);
 
-        var props =
+        let props =
             Services.strings.createBundle(
                 "chrome://calendar/locale/dateFormat.properties");
-        var mainbox =
+        let mainbox =
             document.getAnonymousElementByAttribute(
                 this, "anonid", "mainbox");
-        var numChilds = mainbox.childNodes.length;
-        for (var i = 0; i < numChilds; i++) {
-            var child = mainbox.childNodes[i];
-            var dow = i + this.weekStartOffset;
+        let numChilds = mainbox.childNodes.length;
+        for (let i = 0; i < numChilds; i++) {
+            let child = mainbox.childNodes[i];
+            let dow = i + this.weekStartOffset;
             if (dow >= 7) {
                 dow -= 7;
             }
-            var day = props.GetStringFromName("day." + (dow + 1) + ".Mmm");
+            let day = props.GetStringFromName("day." + (dow + 1) + ".Mmm");
             child.label = day;
             child.calendar = this;
         }
       ]]></constructor>
 
     </implementation>
   </binding>
 
@@ -224,26 +224,26 @@
               let lastDayOffset = val[i] == -1 ? 0 : -1;
               let index = (val[i] < 0 ? val[i] + days.length + lastDayOffset
                                       : val[i] - 1);
               days[index].setAttribute("checked", "true");
           }
           return val;
         ]]></setter>
         <getter><![CDATA[
-          var mainbox =
+          let mainbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "mainbox");
-          var numRows = mainbox.childNodes.length;
-          var days = [];
-          for (var i = 0; i < numRows; i++) {
-              var row = mainbox.childNodes[i];
-              var numChilds = row.childNodes.length;
-              for (var j = 0; j < numChilds; j++) {
-                  var child = row.childNodes[j];
+          let numRows = mainbox.childNodes.length;
+          let days = [];
+          for (let i = 0; i < numRows; i++) {
+              let row = mainbox.childNodes[i];
+              let numChilds = row.childNodes.length;
+              for (let j = 0; j < numChilds; j++) {
+                  let child = row.childNodes[j];
                   if (child.getAttribute("checked") == "true") {
                       days.push(Number(child.label) ? Number(child.label) : -1);
                   }
               }
           }
           return days;
         ]]></getter>
       </property>
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -24,17 +24,17 @@ var gInvitationsRequestManager = {
             this.mRequestStatusList[calendar.id] = op;
         }
     },
 
     /**
      * Cancel all pending requests
      */
     cancelPendingRequests: function IRM_cancelPendingRequests() {
-        for (var id in this.mRequestStatusList) {
+        for (let id in this.mRequestStatusList) {
             let request = this.mRequestStatusList[id];
             if (request && request.isPending) {
                 request.cancel(null);
             }
         }
         this.mRequestStatusList = {};
     }
 };
@@ -61,17 +61,17 @@ function getInvitationsManager() {
  * @constructor
  */
 function InvitationsManager() {
     this.mItemList = [];
     this.mStartDate = null;
     this.mJobsPending = 0;
     this.mTimer = null;
 
-    var self = this;
+    let self = this;
     window.addEventListener("unload", function() {
         // Unload handlers get removed automatically
         self.cancelInvitationsUpdate();
     }, false);
 }
 
 InvitationsManager.prototype = {
     mItemList: null,
@@ -84,17 +84,17 @@ InvitationsManager.prototype = {
      *
      * @param firstDelay          The timeout before the operation should start.
      * @param operationListener   The calIGenericOperationListener to notify.
      */
     scheduleInvitationsUpdate: function IM_scheduleInvitationsUpdate(firstDelay,
                                                                      operationListener) {
         this.cancelInvitationsUpdate();
 
-        var self = this;
+        let self = this;
         this.mTimer = setTimeout(function startInvitationsTimer() {
             if (Preferences.get("calendar.invitations.autorefresh.enabled", true)) {
                 self.mTimer = setInterval(function repeatingInvitationsTimer() {
                     self.getInvitations(operationListener);
                     }, Preferences.get("calendar.invitations.autorefresh.timeout", 3) * 60000);
             }
             self.getInvitations(operationListener);
         }, firstDelay);
@@ -112,48 +112,48 @@ InvitationsManager.prototype = {
      * operation listeners.
      *
      * @param operationListener1    The first operation listener to notify.
      * @param operationListener2    (optinal) The second operation listener to
      *                                notify.
      */
     getInvitations: function IM_getInvitations(operationListener1,
                                                operationListener2) {
-        var listeners = [];
+        let listeners = [];
         if (operationListener1) {
             listeners.push(operationListener1);
         }
         if (operationListener2) {
             listeners.push(operationListener2);
         }
 
         gInvitationsRequestManager.cancelPendingRequests();
         this.updateStartDate();
         this.deleteAllItems();
 
-        var cals = getCalendarManager().getCalendars({});
+        let cals = getCalendarManager().getCalendars({});
 
-        var opListener = {
+        let opListener = {
             QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
             mCount: cals.length,
             mRequestManager: gInvitationsRequestManager,
             mInvitationsManager: this,
             mHandledItems: {},
 
             // calIOperationListener
             onOperationComplete: function(aCalendar,
                                           aStatus,
                                           aOperationType,
                                           aId,
                                           aDetail) {
                 if (--this.mCount == 0) {
                     this.mInvitationsManager.mItemList.sort((a, b) => {
                         return a.startDate.compare(b.startDate);
                     });
-                    for (var listener of listeners) {
+                    for (let listener of listeners) {
                         try {
                             if (this.mInvitationsManager.mItemList.length) {
                                 // Only call if there are actually items
                                 listener.onGetResult(null,
                                                      Components.results.NS_OK,
                                                      Components.interfaces.calIItemBase,
                                                      null,
                                                      this.mInvitationsManager.mItemList.length,
@@ -173,48 +173,48 @@ InvitationsManager.prototype = {
 
             onGetResult: function(aCalendar,
                                   aStatus,
                                   aItemType,
                                   aDetail,
                                   aCount,
                                   aItems) {
                 if (Components.isSuccessCode(aStatus)) {
-                    for (var item of aItems) {
+                    for (let item of aItems) {
                         // we need to retrieve by occurrence to properly filter exceptions,
                         // should be fixed with bug 416975
                         item = item.parentItem;
-                        var hid = item.hashId;
+                        let hid = item.hashId;
                         if (!this.mHandledItems[hid]) {
                             this.mHandledItems[hid] = true;
                             this.mInvitationsManager.addItem(item);
                         }
                     }
                 }
             }
         };
 
-        for (var calendar of cals) {
+        for (let calendar of cals) {
             if (!isCalendarWritable(calendar) || calendar.getProperty("disabled")) {
                 opListener.onOperationComplete();
                 continue;
             }
 
             // temporary hack unless calCachedCalendar supports REQUEST_NEEDS_ACTION filter:
             calendar = calendar.getProperty("cache.uncachedCalendar");
             if (!calendar) {
                 opListener.onOperationComplete();
                 continue;
             }
 
             try {
                 calendar = calendar.QueryInterface(Components.interfaces.calICalendar);
-                var endDate = this.mStartDate.clone();
+                let endDate = this.mStartDate.clone();
                 endDate.year += 1;
-                var op = calendar.getItems(Components.interfaces.calICalendar.ITEM_FILTER_REQUEST_NEEDS_ACTION |
+                let op = calendar.getItems(Components.interfaces.calICalendar.ITEM_FILTER_REQUEST_NEEDS_ACTION |
                                            Components.interfaces.calICalendar.ITEM_FILTER_TYPE_ALL |
                                            // we need to retrieve by occurrence to properly filter exceptions,
                                            // should be fixed with bug 416975
                                            Components.interfaces.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES,
                                            0, this.mStartDate,
                                            endDate /* we currently cannot pass null here, because of bug 416975 */,
                                            opListener);
                 gInvitationsRequestManager.addRequestStatus(calendar, op);
@@ -234,17 +234,17 @@ InvitationsManager.prototype = {
      * @param onLoadOpListener          The operation listener to notify when
      *                                    getting invitations. Should be passed
      *                                    to this.getInvitations().
      * @param finishedCallBack          A callback function to call when the
      *                                    dialog has completed.
      */
     openInvitationsDialog: function IM_openInvitationsDialog(onLoadOpListener,
                                                              finishedCallBack) {
-        var args = {};
+        let args = {};
         args.onLoadOperationListener = onLoadOpListener;
         args.queue = [];
         args.finishedCallBack = finishedCallBack;
         args.requestManager = gInvitationsRequestManager;
         args.invitationsManager = this;
         // the dialog will reset this to auto when it is done loading
         window.setCursor("wait");
         // open the dialog
@@ -298,20 +298,20 @@ InvitationsManager.prototype = {
                                   aDetail,
                                   aCount,
                                   aItems) {
 
             }
         };
 
         this.mJobsPending = 0;
-        for (var i = 0; i < queue.length; i++) {
-            var job = queue[i];
-            var oldItem = job.oldItem;
-            var newItem = job.newItem;
+        for (let i = 0; i < queue.length; i++) {
+            let job = queue[i];
+            let oldItem = job.oldItem;
+            let newItem = job.newItem;
             switch (job.action) {
                 case 'modify':
                     this.mJobsPending++;
                     newItem.calendar.modifyItem(newItem,
                                                 oldItem,
                                                 new operationListener(this, jobQueueFinishedCallBack, oldItem));
                     break;
                 default:
@@ -326,53 +326,53 @@ InvitationsManager.prototype = {
     /**
      * Checks if the internal item list contains the given item
      * XXXdbo       Please document these correctly.
      *
      * @param item      The item to look for.
      * @return          A boolean value indicating if the item was found.
      */
     hasItem: function IM_hasItem(item) {
-        var hid = item.hashId;
+        let hid = item.hashId;
         return this.mItemList.some(
             function someFunc(item_) {
                 return hid == item_.hashId;
             });
     },
 
     /**
      * Adds an item to the internal item list.
      * XXXdbo       Please document these correctly.
      *
      * @param item      The item to add.
      */
     addItem: function IM_addItem(item) {
-        var recInfo = item.recurrenceInfo;
+        let recInfo = item.recurrenceInfo;
         if (recInfo && !cal.isOpenInvitation(item)) {
             // scan exceptions:
-            var ids = recInfo.getExceptionIds({});
-            for (var id of ids) {
-                var ex = recInfo.getExceptionFor(id);
+            let ids = recInfo.getExceptionIds({});
+            for (let id of ids) {
+                let ex = recInfo.getExceptionFor(id);
                 if (ex && this.validateItem(ex) && !this.hasItem(ex)) {
                     this.mItemList.push(ex);
                 }
             }
         } else if (this.validateItem(item) && !this.hasItem(item)) {
             this.mItemList.push(item);
         }
     },
 
     /**
      * Removes an item from the internal item list
      * XXXdbo       Please document these correctly.
      *
      * @param item      The item to remove.
      */
     deleteItem: function IM_deleteItem(item) {
-        var id = item.id;
+        let id = item.id;
         this.mItemList.filter(
             function filterFunc(item_) {
                 return id != item_.id;
             });
     },
 
     /**
      * Remove all items from the internal item list
@@ -384,33 +384,33 @@ InvitationsManager.prototype = {
 
     /**
      * Helper function to create a start date to search from. This date is the
      * current time with hour/minute/second set to zero.
      *
      * @return      Potential start date.
      */
     getStartDate: function IM_getStartDate() {
-        var date = now();
+        let date = now();
         date.second = 0;
         date.minute = 0;
         date.hour = 0;
         return date;
     },
 
     /**
      * Updates the start date for the invitations manager to the date returned
      * from this.getStartDate(), unless the previously existing start date is
      * the same or after what getStartDate() returned.
      */
     updateStartDate: function IM_updateStartDate() {
         if (!this.mStartDate) {
             this.mStartDate = this.getStartDate();
         } else {
-            var startDate = this.getStartDate();
+            let startDate = this.getStartDate();
             if (startDate.compare(this.mStartDate) > 0) {
                 this.mStartDate = startDate;
             }
         }
     },
 
     /**
      * Checks if the item is valid for the invitation manager. Checks if the
@@ -420,13 +420,13 @@ InvitationsManager.prototype = {
      * @param item      The item to check
      * @return          A boolean indicating if the item is a valid invitation.
      */
     validateItem: function IM_validateItem(item) {
         if (item.calendar instanceof Components.interfaces.calISchedulingSupport &&
             !item.calendar.isInvitation(item)) {
             return false; // exclude if organizer has invited himself
         }
-        var start = item[calGetStartDateProp(item)] || item[calGetEndDateProp(item)];
+        let start = item[calGetStartDateProp(item)] || item[calGetEndDateProp(item)];
         return (cal.isOpenInvitation(item) &&
                 start.compare(this.mStartDate) >= 0);
     }
 };
--- a/calendar/base/content/calendar-item-editing.js
+++ b/calendar/base/content/calendar-item-editing.js
@@ -222,17 +222,17 @@ function setDefaultItemValues(aItem, aCa
  * @param summary       (optional) The event's title.
  * @param event         (optional) A template event to show in the dialog
  * @param aForceAllDay  (optional) Make sure the event shown in the dialog is an
  *                                   allday event.
  */
 function createEventWithDialog(calendar, startDate, endDate, summary, event, aForceAllday) {
     const kDefaultTimezone = calendarDefaultTimezone();
 
-    var onNewEvent = function(item, opcalendar, originalItem, listener) {
+    let onNewEvent = function(item, opcalendar, originalItem, listener) {
         if (item.id) {
             // If the item already has an id, then this is the result of
             // saving the item without closing, and then saving again.
             doTransaction('modify', item, opcalendar, originalItem, listener);
         } else {
             // Otherwise, this is an addition
             doTransaction('add', item, opcalendar, null, listener);
         }
@@ -279,17 +279,17 @@ function createEventWithDialog(calendar,
  * @param dueDate       (optional) The task's due date.
  * @param summary       (optional) The task's title.
  * @param todo          (optional) A template task to show in the dialog.
  * @param initialDate   (optional) The initial date for new task datepickers
  */
 function createTodoWithDialog(calendar, dueDate, summary, todo, initialDate) {
     const kDefaultTimezone = calendarDefaultTimezone();
 
-    var onNewItem = function(item, opcalendar, originalItem, listener) {
+    let onNewItem = function(item, opcalendar, originalItem, listener) {
         if (item.id) {
             // If the item already has an id, then this is the result of
             // saving the item without closing, and then saving again.
             doTransaction('modify', item, opcalendar, originalItem, listener);
         } else {
             // Otherwise, this is an addition
             doTransaction('add', item, opcalendar, null, listener);
         }
@@ -372,20 +372,20 @@ function openEventDialog(calendarItem, c
         dlg.focus();
         disposeJob(job);
         return;
     }
 
     // Set up some defaults
     mode = mode || "new";
     calendar = calendar || getSelectedCalendar();
-    var calendars = getCalendarManager().getCalendars({});
+    let calendars = getCalendarManager().getCalendars({});
     calendars = calendars.filter(isCalendarWritable);
 
-    var isItemSupported;
+    let isItemSupported;
     if (isToDo(calendarItem)) {
         isItemSupported = function isTodoSupported(aCalendar) {
             return (aCalendar.getProperty("capabilities.tasks.supported") !== false);
         };
     } else if (isEvent(calendarItem)) {
         isItemSupported = function isEventSupported(aCalendar) {
             return (aCalendar.getProperty("capabilities.events.supported") !== false);
         };
@@ -429,17 +429,17 @@ function openEventDialog(calendarItem, c
                 // choice. Since we are shortly before a release to keep
                 // regression risk low, explicitly set the item's calendar here.
                 calendarItem.calendar = calendars[0];
             }
         }
     }
 
     // Setup the window arguments
-    var args = {};
+    let args = {};
     args.calendarEvent = calendarItem;
     args.calendar = calendar;
     args.mode = mode;
     args.onOk = callback;
     args.job = job;
     args.initialStartDateValue = (initialDate || getDefaultStartDate());
     args.inTab = Preferences.get("calendar.item.editInTab", false);
     args.useNewItemUI = Preferences.get("calendar.item.useNewItemUI", false);
@@ -539,32 +539,32 @@ function openEventDialog(calendarItem, c
  *                                        response of the dialog as a constant.
  */
 function promptOccurrenceModification(aItem, aNeedsFuture, aAction) {
     const CANCEL = 0;
     const MODIFY_OCCURRENCE = 1;
     const MODIFY_FOLLOWING = 2;
     const MODIFY_PARENT = 3;
 
-    var futureItem = false;
-    var pastItem;
-    var type = CANCEL;
+    let futureItem = false;
+    let pastItem;
+    let type = CANCEL;
 
     // Check if this actually is an instance of a recurring event
     if (aItem == aItem.parentItem) {
         type = MODIFY_PARENT;
     } else if (aItem.parentItem.recurrenceInfo.getExceptionFor(aItem.recurrenceId)) {
         // If the user wants to edit an occurrence which is already an exception
         // always edit this single item.
         // XXX  Why? I think its ok to ask also for exceptions.
         type = MODIFY_OCCURRENCE;
     } else {
         // Prompt the user. Setting modal blocks the dialog until it is closed. We
         // use rv to pass our return value.
-        var rv = { value: CANCEL, item: aItem, action: aAction};
+        let rv = { value: CANCEL, item: aItem, action: aAction};
         window.openDialog("chrome://calendar/content/calendar-occurrence-prompt.xul",
                           "PromptOccurrenceModification",
                           "centerscreen,chrome,modal,titlebar",
                           rv);
         type = rv.value;
     }
 
     switch (type) {
--- a/calendar/base/content/calendar-menus.xml
+++ b/calendar/base/content/calendar-menus.xml
@@ -12,17 +12,17 @@
  xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="task-menupopup" extends="xul:menupopup">
     <implementation>
       <field name="mType">null</field>;
       <field name="mPopupHandler">null</field>
       <field name="mParentMenuPopup">null</field>
       <constructor><![CDATA[
-        var self = this;
+        let self = this;
         this.mPopupHandler = function popupHandler() { self.changeMenuByPropertyName(); };
         this.mParentMenuPopup = getParentNodeOrThis(this, "menupopup");
         this.mParentMenuPopup.addEventListener("popupshowing", this.mPopupHandler, true);
       ]]></constructor>
       <destructor><![CDATA[
         this.mParentMenuPopup.removeEventListener("popupshowing", this.mPopupHandler, true);
       ]]></destructor>
 
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -76,27 +76,27 @@
         <getter><![CDATA[
             return this.mOccurrence;
         ]]></getter>
         <setter><![CDATA[
           ASSERT(!this.mOccurrence, "Code changes needed to set the occurrence twice", true);
           this.mOccurrence = val;
           if (cal.isEvent(val)) {
             if (!val.startDate.isDate) {
-              var label = document.getAnonymousElementByAttribute(this, "anonid", "item-label");
-              var df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"].
+              let label = document.getAnonymousElementByAttribute(this, "anonid", "item-label");
+              let df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"].
                        getService(Components.interfaces.calIDateTimeFormatter);
-              var timezone = this.calendarView ? this.calendarView.mTimezone :
+              let timezone = this.calendarView ? this.calendarView.mTimezone :
                              calendarDefaultTimezone();
-              var parentDate = ensureDateTime(this.parentBox.date);
-              var startTime = val.startDate.getInTimezone(timezone);
-              var endTime = val.endDate.getInTimezone(timezone);
-              var nextDay = parentDate.clone();
+              let parentDate = ensureDateTime(this.parentBox.date);
+              let startTime = val.startDate.getInTimezone(timezone);
+              let endTime = val.endDate.getInTimezone(timezone);
+              let nextDay = parentDate.clone();
               nextDay.day++;
-              var comp = endTime.compare(nextDay);
+              let comp = endTime.compare(nextDay);
               if (startTime.compare(parentDate) == -1) {
                 if (comp == 1) {
                   label.value = "↔";
                 } else if (comp == 0) {
                   label.value = "↤";
                 } else {
                   label.value = "⇥ " + df.formatTime(endTime);
                 }
@@ -146,17 +146,17 @@
       <field name="mShowMonthLabel">false</field>
 
       <property name="date"
                 onget="return this.mDate"
                 onset="this.setDate(val); return val;"/>
 
       <property name="selected">
         <getter><![CDATA[
-          var sel = this.getAttribute("selected");
+          let sel = this.getAttribute("selected");
           if (sel && sel == "true") {
             return true;
           }
 
           return false;
         ]]></getter>
         <setter><![CDATA[
           if (val) {
@@ -418,17 +418,17 @@
       <!-- constructor -->
       <constructor><![CDATA[
           Components.utils.import("resource://gre/modules/Preferences.jsm");
           Components.utils.import("resource://calendar/modules/calViewUtils.jsm");
 
           // Set the preference for the default start of the week
           this.weekStartOffset = Preferences.get("calendar.week.start", 0);
 
-          for (var i = 0; i < 7; i++) {
+          for (let i = 0; i < 7; i++) {
               let hdr = createXULElement("calendar-day-label");
               this.labeldaybox.appendChild(hdr);
               hdr.weekDay = (i + this.mWeekStartOffset) % 7;
               hdr.shortWeekNames = false;
           }
 
           // Set the preference for displaying the week number
           this.mShowWeekNumber = Preferences.get('calendar.view-minimonth.showWeekNumber', true);
@@ -587,17 +587,17 @@
 
           return null;
         ]]></getter>
         <setter><![CDATA[
           if (this.mSelectedDayBox) {
             this.mSelectedDayBox.selected = false;
           }
 
-          var realVal = val;
+          let realVal = val;
           if (!realVal.isDate) {
             realVal = val.clone();
             realVal.isDate = true;
           }
           let box = this.findDayBoxForDate(realVal);
           if (box) {
             box.selected = true;
             this.mSelectedDayBox = box;
@@ -750,66 +750,66 @@
 
           if (!this.mStartDate || !this.mEndDate) {
             throw Components.results.NS_ERROR_FAILURE;
           }
 
           // Days that are not in the main month on display are displayed with
           // a gray background.  Unless the month actually starts on a Sunday,
           // this means that mStartDate.month is 1 month less than the main month
-          var mainMonth = this.mStartDate.month;
+          let mainMonth = this.mStartDate.month;
           if (this.mStartDate.day != 1) {
             mainMonth++;
             mainMonth = mainMonth % 12;
           }
 
-          var dateBoxes = [];
-          var today = this.today();
+          let dateBoxes = [];
+          let today = this.today();
 
           // This gets set to true, telling us to collapse the rest of the rows
-          var finished = false;
-          var dateList = this.getDateList({});
+          let finished = false;
+          let 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;
+          let rows = this.monthgridrows.childNodes;
 
           // 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
           // coming out.
-          for (var i = 0; i < rows.length; i++) {
-            var row = rows[i];
+          for (let i = 0; i < rows.length; i++) {
+            let row = rows[i];
             // 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++) {
-              var daybox = row.childNodes[j];
-              var dt = dateList[dateBoxes.length];
+            for (let j = 0; j < row.childNodes.length; j++) {
+              let daybox = row.childNodes[j];
+              let dt = dateList[dateBoxes.length];
 
               // Remove the attribute "relation" for all the column headers.
               // Consider only the first row index otherwise it will be
               // removed again afterwards the correct setting.
               if (i == 0) {
                   this.labeldaybox.childNodes[j].removeAttribute("relation");
               }
 
               daybox.setAttribute("context", this.getAttribute("context"));
               daybox.setAttribute("item-context", this.getAttribute("item-context") || this.getAttribute("context"));
 
               // Set the box-class depending on if this box displays a day in
               // the month being currently shown or not.
-              var boxClass;
+              let boxClass;
               if (this.showFullMonth) {
                   boxClass = "calendar-month-day-box-" +
                              (mainMonth == dt.month ? "current-month" : "other-month");
               } else {
                   boxClass = "calendar-month-day-box-current-month";
               }
               if (this.mDaysOffArray.some(dayOffNum => dayOffNum == dt.weekday)) {
                 boxClass = "calendar-month-day-box-day-off " + boxClass;
@@ -916,21 +916,21 @@
               weekLabel.hidden = true;
             }
           }
         ]]></body>
       </method>
 
       <method name="hideDaysOff">
         <body><![CDATA[
-          var columns = document.getAnonymousElementByAttribute(this, "anonid", "monthgridcolumns").childNodes;
+          let columns = document.getAnonymousElementByAttribute(this, "anonid", "monthgridcolumns").childNodes;
           let headerkids = document.getAnonymousElementByAttribute(this, "anonid", "labeldaybox").childNodes;
           for (let i = 0; i < columns.length; i++) {
-            var dayForColumn = (i + this.mWeekStartOffset) % 7;
-            var dayOff = this.mDaysOffArray.includes(dayForColumn);
+            let dayForColumn = (i + this.mWeekStartOffset) % 7;
+            let dayOff = this.mDaysOffArray.includes(dayForColumn);
             columns[i].collapsed = dayOff && !this.mDisplayDaysOff;
             headerkids[i].collapsed = dayOff && !this.mDisplayDaysOff;
           }
         ]]></body>
       </method>
 
       <method name="findDayBoxForDate">
         <parameter name="aDate"/>
@@ -945,19 +945,19 @@
           }
           return null;
         ]]></body>
       </method>
 
       <method name="findDayBoxesForItem">
         <parameter name="aItem"/>
         <body><![CDATA[
-          var targetDate = null;
-          var finishDate = null;
-          var boxes = [];
+          let targetDate = null;
+          let finishDate = null;
+          let boxes = [];
 
           // All our boxes are in default tz, so we need these times in them too.
           if (cal.isEvent(aItem)) {
               targetDate = aItem.startDate.getInTimezone(this.mTimezone);
               finishDate = aItem.endDate.getInTimezone(this.mTimezone);
           } else if (cal.isToDo(aItem)) {
               // Consider tasks without entry OR due date.
               if (aItem.entryDate || aItem.dueDate) {
@@ -1030,17 +1030,17 @@
 
           if (!boxes.length) {
               return;
           }
 
           function isNotItem(a) {
               return (a.hashId != aItem.hashId);
           }
-          var oldLength = this.mSelectedItems.length;
+          let oldLength = this.mSelectedItems.length;
           this.mSelectedItems = this.mSelectedItems.filter(isNotItem);
 
           for (let box of boxes) {
               box.deleteItem(aItem);
           }
 
           // If a deleted event was selected, we need to announce that the
           // selection changed.
@@ -1067,43 +1067,43 @@
           }
         ]]></body>
       </method>
 
       <method name="flashAlarm">
         <parameter name="aAlarmItem"/>
         <parameter name="aStop"/>
         <body><![CDATA[
-          var showIndicator = Preferences.get("calendar.alarms.indicator.show", true);
-          var totaltime = Preferences.get("calendar.alarms.indicator.totaltime", 3600);
+          let showIndicator = Preferences.get("calendar.alarms.indicator.show", true);
+          let totaltime = Preferences.get("calendar.alarms.indicator.totaltime", 3600);
 
           if (!aStop && (!showIndicator || totaltime < 1)) {
             // No need to animate if the indicator should not be shown.
             return;
           }
 
           // Make sure the flashing attribute is set or reset on all visible
           // boxes.
           let boxes = this.findDayBoxesForItem(aAlarmItem);
-          for (var box of boxes) {
-            for (var id in box.mItemHash) {
+          for (let box of boxes) {
+            for (let id in box.mItemHash) {
               let itemData = box.mItemHash[id];
               if (itemData.item.hasSameIds(aAlarmItem)) {
                 if (aStop) {
                   itemData.removeAttribute("flashing");
                 } else {
                   itemData.setAttribute("flashing", "true");
                 }
               }
             }
           }
 
           if (!aStop) {
             // Set up a timer to stop the flashing after the total time.
-            var this_ = this;
+            let this_ = this;
             this.mFlashingEvents[aAlarmItem.hashId] = aAlarmItem;
             setTimeout(function() { this_.flashAlarm(aAlarmItem, true); }, totaltime);
           } else {
             // We are done flashing, prevent newly created event boxes from flashing.
             delete this.mFlashingEvents[aAlarmItem.hashId];
           }
         ]]></body>
       </method>
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -46,114 +46,114 @@
               aDayEndHour * 60 > this.mEndMin) {
               throw Components.results.NS_ERROR_INVALID_ARG;
           }
           if (this.mDayStartHour != aDayStartHour ||
               this.mDayEndHour != aDayEndHour) {
               this.mDayEndHour = aDayEndHour;
               this.mDayStartHour = aDayStartHour;
 
-              var topbox = document.getAnonymousElementByAttribute(this, "anonid", "topbox");
+              let topbox = document.getAnonymousElementByAttribute(this, "anonid", "topbox");
               if (topbox.childNodes.length) {
                   // This only needs to be done if the initial relayout has
                   // already happened, otherwise it will be done then.
-                  for (var hour = this.mStartMin / 60; hour < this.mEndMin / 60; hour++) {
+                  for (let hour = this.mStartMin / 60; hour < this.mEndMin / 60; hour++) {
                       if (hour < this.mDayStartHour || hour >= this.mDayEndHour) {
                           topbox.childNodes[hour].setAttribute("off-time", "true");
                       } else {
                           topbox.childNodes[hour].removeAttribute("off-time");
                       }
                   }
               }
           }
         ]]></body>
       </method>
 
       <method name="setAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
         <body><![CDATA[
-          var needsrelayout = false;
+          let needsrelayout = false;
           if (aAttr == "orient") {
               if (this.getAttribute("orient") != aVal) {
                   needsrelayout = true;
               }
           }
 
           // this should be done using lookupMethod(), see bug 286629
-          var ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
+          let ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
 
           if (needsrelayout) {
               this.relayout();
           }
 
           return ret;
         ]]></body>
       </method>
 
       <property name="pixelsPerMinute"
         onget="return this.mPixPerMin"
         onset="if (this.mPixPerMin != val) { this.mPixPerMin = val; this.relayout(); } return val;"/>
 
       <method name="relayout">
         <body><![CDATA[
-          var topbox = document.getAnonymousElementByAttribute(this, "anonid", "topbox");
-          var orient = topbox.getAttribute("orient");
-          var otherorient = getOtherOrientation(orient);
+          let topbox = document.getAnonymousElementByAttribute(this, "anonid", "topbox");
+          let orient = topbox.getAttribute("orient");
+          let otherorient = getOtherOrientation(orient);
 
 
           function makeTimeBox(timestr, size) {
-              var box = createXULElement("box");
+              let box = createXULElement("box");
               box.setAttribute("orient", orient);
 
               if (orient == "horizontal") {
                   box.setAttribute("width", size);
               } else {
                   box.setAttribute("height", size);
               }
 
-              var label = createXULElement("label");
+              let label = createXULElement("label");
               label.setAttribute("class", "calendar-time-bar-label");
               label.setAttribute("value", timestr);
               label.setAttribute("align", "center");
 
               box.appendChild(label);
 
               return box;
           }
 
           while (topbox.hasChildNodes()) {
               topbox.lastChild.remove();
           }
 
-          var formatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
+          let formatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
                           getService(Components.interfaces.nsIScriptableDateFormat);
-          var timeString;
-          var theMin = this.mStartMin;
-          var theHour = Math.floor(theMin / 60);
-          var durLeft = this.mEndMin - this.mStartMin;
+          let timeString;
+          let theMin = this.mStartMin;
+          let theHour = Math.floor(theMin / 60);
+          let durLeft = this.mEndMin - this.mStartMin;
 
           while (durLeft > 0) {
-              var dur;
+              let dur;
               if (this.mEndMin - theMin < 60) {
                   dur = this.mEndMin - theMin;
               } else {
                   dur = theMin % 60;
               }
               theMin += dur;
               if (dur == 0) {
                   dur = 60;
               }
 
               // calculate duration pixel as the difference between
               // start pixel and end pixel to avoid rounding errors.
-              var startPix = Math.round(theMin * this.mPixPerMin);
-              var endPix = Math.round((theMin + dur) * this.mPixPerMin);
-              var durPix = endPix - startPix;
-              var box;
+              let startPix = Math.round(theMin * this.mPixPerMin);
+              let endPix = Math.round((theMin + dur) * this.mPixPerMin);
+              let durPix = endPix - startPix;
+              let box;
               if (dur != 60) {
                   box = makeTimeBox("", durPix);
               } else {
                   timeString = formatter.FormatTime("",
                                                     Components.interfaces.nsIScriptableDateFormat.timeFormatNoSeconds,
                                                     theHour, 0, 0);
                   box = makeTimeBox(timeString, durPix);
               }
@@ -191,17 +191,17 @@
      </content>
 
     <implementation>
       <property name="parentorient">
         <getter><![CDATA[
           return this.getAttribute("parentorient");
         ]]></getter>
         <setter><![CDATA[
-          var thebox = document.getAnonymousElementByAttribute(this, "anonid", "thebox");
+          let thebox = document.getAnonymousElementByAttribute(this, "anonid", "thebox");
           this.setAttribute("parentorient", val);
           thebox.setAttribute("orient", getOtherOrientation(val));
           return val;
         ]]></setter>
       </property>
 
       <!-- private -->
       <constructor><![CDATA[
@@ -310,17 +310,17 @@
       <field name="mSelected">false</field>
       <property name="selected">
         <getter><![CDATA[
           return this.mSelected;
         ]]></getter>
         <setter><![CDATA[
           this.mSelected = val;
           if (this.bgbox && this.bgbox.hasChildNodes()) {
-            var child = this.bgbox.firstChild;
+            let child = this.bgbox.firstChild;
             while (child) {
               if (val) {
                 child.setAttribute("selected", "true");
               } else {
                 child.removeAttribute("selected");
               }
               child = child.nextSibling;
             }
@@ -412,46 +412,46 @@
       <!-- mEventInfos -->
       <field name="mSelectedChunks">[]</field>
 
       <method name="selectOccurrence">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
           if (aOccurrence) {
               this.mSelectedItemIds[aOccurrence.hashId] = true;
-              var chunk = this.findChunkForOccurrence(aOccurrence);
+              let chunk = this.findChunkForOccurrence(aOccurrence);
               if (!chunk) {
                   return;
               }
               chunk.selected = true;
               this.mSelectedChunks.push(chunk);
           }
         ]]></body>
       </method>
 
       <method name="unselectOccurrence">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
           if (aOccurrence) {
               delete this.mSelectedItemIds[aOccurrence.hashId];
-              var chunk = this.findChunkForOccurrence(aOccurrence);
+              let chunk = this.findChunkForOccurrence(aOccurrence);
               if (!chunk) {
                   return;
               }
               chunk.selected = false;
-              var index = this.mSelectedChunks.indexOf(chunk);
+              let index = this.mSelectedChunks.indexOf(chunk);
               this.mSelectedChunks.splice(index, 1);
           }
         ]]></body>
       </method>
 
       <method name="findChunkForOccurrence">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-          for (var chunk of this.mEventBoxes) {
+          for (let chunk of this.mEventBoxes) {
               if (chunk.occurrence.hashId == aOccurrence.hashId) {
                   return chunk;
               }
           }
 
           return null;
         ]]></body>
       </method>
@@ -470,32 +470,32 @@
         ]]></body>
       </method>
 
       <method name="setAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
         <body><![CDATA[
           // this should be done using lookupMethod(), see bug 286629
-          var ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
+          let ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
 
           if (aAttr == "orient" && this.getAttribute("orient") != aVal) {
               this.relayout();
           }
 
           return ret;
         ]]></body>
       </method>
 
       <method name="internalDeleteEvent">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           var itemIndex = -1;
-           var occ;
-           for (var i in this.mEventInfos) {
+           let itemIndex = -1;
+           let occ;
+           for (let i in this.mEventInfos) {
                occ = this.mEventInfos[i].event;
                if (occ.hashId == aOccurrence.hashId) {
                    itemIndex = i;
                    break;
                }
            }
 
            if (itemIndex != -1) {
@@ -508,18 +508,18 @@
            } else {
                return false;
            }
         ]]></body>
       </method>
 
       <method name="recalculateStartEndMinutes">
         <body><![CDATA[
-          for (var chunk of this.mEventInfos) {
-              var mins = this.getStartEndMinutesForOccurrence(chunk.event);
+          for (let chunk of this.mEventInfos) {
+              let mins = this.getStartEndMinutesForOccurrence(chunk.event);
               chunk.startMinute = mins.start;
               chunk.endMinute = mins.end;
           }
 
           this.relayout();
         ]]></body>
       </method>
 
@@ -536,20 +536,20 @@
            if (!compareObjects(stdate.timezone, this.mTimezone)) {
                stdate = stdate.getInTimezone(this.mTimezone);
            }
 
            if (!compareObjects(enddate.timezone, this.mTimezone)) {
                enddate = enddate.getInTimezone(this.mTimezone);
            }
 
-           var startHour = stdate.hour;
-           var startMinute = stdate.minute;
-           var endHour = enddate.hour;
-           var endMinute = enddate.minute;
+           let startHour = stdate.hour;
+           let startMinute = stdate.minute;
+           let endHour = enddate.hour;
+           let endMinute = enddate.minute;
 
            // Handle cases where an event begins or ends on a day other than this
            if (stdate.compare(this.mDate) == -1) {
                startHour = 0;
                startMinute = 0;
            }
            if (enddate.compare(this.mDate) == 1) {
                endHour = 24;
@@ -572,38 +572,38 @@
                     realStart:    realStart_,
                     realEnd:      realEnd_ };
         ]]></body>
       </method>
 
       <method name="createChunk">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           var mins = this.getStartEndMinutesForOccurrence(aOccurrence);
-
-           var chunk = {
+           let mins = this.getStartEndMinutesForOccurrence(aOccurrence);
+
+           let chunk = {
                startMinute: mins.start,
                endMinute: mins.end,
                event: aOccurrence
            };
            return chunk;
         ]]></body>
       </method>
 
       <method name="addEvent">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
            this.internalDeleteEvent(aOccurrence);
 
-           var chunk = this.createChunk(aOccurrence);
+           let chunk = this.createChunk(aOccurrence);
            this.mEventInfos.push(chunk);
            if (this.mEventMapTimeout) {
                clearTimeout(this.mEventMapTimeout);
            }
-           var column = this;
+           let column = this;
 
            if (this.mCreatedNewEvent) {
                this.mEventToEdit = aOccurrence;
            }
            // Fun with scoping...
            this.mEventMapTimeout = setTimeout(function() { column.relayout.call(column); }, 5);
         ]]></body>
       </method>
@@ -871,31 +871,31 @@
            *
            * Each blob will be an array of objects with the following properties:
            *    item:     the event/task
            *    startCol: the starting column to display the event in (0-indexed)
            *    colSpan:  the number of columns the item spans
            *
            * An item with no conflicts will have startCol: 0 and colSpan: 1.
            */
-          var blobs = [];
-          var currentBlob = [];
+          let blobs = [];
+          let currentBlob = [];
           function sortByStart(aEventInfo, bEventInfo) {
               // If you pass in tasks without both entry and due dates, I will
               // kill you
-              var startComparison = aEventInfo.layoutStart.compare(bEventInfo.layoutStart);
+              let startComparison = aEventInfo.layoutStart.compare(bEventInfo.layoutStart);
               if (startComparison != 0) {
                   return startComparison;
               } else {
                   // If the items start at the same time, return the longer one
                   // first
                   return bEventInfo.layoutEnd.compare(aEventInfo.layoutEnd);
               }
           }
-          var self = this;
+          let self = this;
           this.mEventInfos.forEach(function(aEventInfo) {
               let item = aEventInfo.event.clone();
               let start = item.startDate || item.entryDate || item.dueDate;
               start = start.getInTimezone(self.mTimezone);
               aEventInfo.layoutStart = start;
               let end = item.endDate || item.dueDate || item.entryDate;
               end = end.getInTimezone(self.mTimezone);
               let secEnd = start.clone();
@@ -905,34 +905,34 @@
               } else {
                    aEventInfo.layoutEnd = end;
               }
               return aEventInfo;
           });
           this.mEventInfos.sort(sortByStart);
 
           // The end time of the last ending event in the entire blob
-          var latestItemEnd;
+          let latestItemEnd;
 
           // This array keeps track of the last (latest ending) item in each of
           // the columns of the current blob. We could reconstruct this data at
           // any time by looking at the items in the blob, but that would hurt
           // perf.
-          var colEndArray = [];
+          let colEndArray = [];
 
           /* Go through a 3 step process to try and place each item.
            * Step 1: Look for an existing column with room for the item.
            * Step 2: Look for a previously placed item that can be shrunk in
            *         width to make room for the item.
            * Step 3: Give up and create a new column for the item.
            *
            * (The steps are explained in more detail as we come to them)
            */
-          for (var i in this.mEventInfos) {
-              var curItemInfo = {event: this.mEventInfos[i].event,
+          for (let i in this.mEventInfos) {
+              let curItemInfo = {event: this.mEventInfos[i].event,
                                  layoutStart: this.mEventInfos[i].layoutStart,
                                  layoutEnd: this.mEventInfos[i].layoutEnd};
               if (!latestItemEnd) {
                  latestItemEnd = curItemInfo.layoutEnd;
               }
               if (currentBlob.length && latestItemEnd &&
                   curItemInfo.layoutStart.compare(latestItemEnd) != -1) {
                   // We're done with this current blob because item starts
@@ -940,17 +940,17 @@
                   blobs.push({blob: currentBlob, totalCols: colEndArray.length});
 
                   // Reset our variables
                   currentBlob = [];
                   colEndArray = [];
               }
 
               // Place the item in its correct place in the blob
-              var placedItem = false;
+              let placedItem = false;
 
               // Step 1
               // Look for a possible column in the blob that has been left open. This
               // would happen if we already have multiple columns but some of
               // the cols have events before latestItemEnd.  For instance
               //       |      |      |
               //       |______|      |
               //       |ev1   |______|
@@ -958,29 +958,29 @@
               //       |______|      |
               //       |      |      |
               //       |OPEN! |      |<--Our item's start time might be here
               //       |      |______|
               //       |      |      |
               //
               // Remember that any time we're starting a new blob, colEndArray
               // will be empty, but that's ok.
-              for (var ii = 0; ii < colEndArray.length; ++ii) {
-                  var colStart = colEndArray[ii].layoutStart;
-                  var colEnd = colEndArray[ii].layoutEnd;
+              for (let ii = 0; ii < colEndArray.length; ++ii) {
+                  let colStart = colEndArray[ii].layoutStart;
+                  let colEnd = colEndArray[ii].layoutEnd;
                   if (colEnd.compare(curItemInfo.layoutStart) != 1) {
                       // Yay, we can jump into this column
                       colEndArray[ii] = curItemInfo;
 
                       // Check and see if there are any adjacent columns we can
                       // jump into as well.
-                      var lastCol = Number(ii) + 1;
+                      let lastCol = Number(ii) + 1;
                       while (lastCol < colEndArray.length) {
-                          var nextColStart = colEndArray[lastCol].layoutStart;
-                          var nextColEnd = colEndArray[lastCol].layoutEnd;
+                          let nextColStart = colEndArray[lastCol].layoutStart;
+                          let nextColEnd = colEndArray[lastCol].layoutEnd;
                           // If the next column's item ends after we start, we
                           // can't expand any further
                           if (nextColEnd.compare(curItemInfo.layoutStart) == 1) {
                               break;
                           }
                           colEndArray[lastCol] = curItemInfo;
                           lastCol++;
                       }
@@ -1015,30 +1015,30 @@
               //       |      |______|      |
               //       |      |      |______|
               //       |      |_____________|
               //       |      |ev2          |
               //       |______|             |<--If our item's start time is
               //       |      |_____________|   here, we can shrink ev2 and jump
               //       |      |      |      |   in column #3
               //
-              for (var jj = 1; jj < colEndArray.length; ++jj) {
+              for (let jj = 1; jj < colEndArray.length; ++jj) {
                   if (colEndArray[jj].event.hashId == colEndArray[jj - 1].event.hashId) {
                       // Good we found a item that spanned multiple columns.
                       // Find it in the blob so we can modify its properties
-                      for (var kk in currentBlob) {
+                      for (let kk in currentBlob) {
                           if (currentBlob[kk].itemInfo.event.hashId == colEndArray[jj].event.hashId) {
                               // Take all but the first spot that the item spanned
-                              var spanOfShrunkItem = currentBlob[kk].colSpan;
+                              let spanOfShrunkItem = currentBlob[kk].colSpan;
                               currentBlob.push({itemInfo: curItemInfo,
                                                 startCol: Number(currentBlob[kk].startCol) + 1,
                                                 colSpan: spanOfShrunkItem - 1});
 
                               // Update colEndArray
-                              for (var ll = jj; ll < jj + spanOfShrunkItem - 1; ll++) {
+                              for (let ll = jj; ll < jj + spanOfShrunkItem - 1; ll++) {
                                   colEndArray[ll] = curItemInfo;
                               }
 
                               // Modify the data on the old item
                               currentBlob[kk] = {itemInfo: currentBlob[kk].itemInfo,
                                                  startCol: currentBlob[kk].startCol,
                                                  colSpan: 1};
                               // Update latestItemEnd
@@ -1065,20 +1065,20 @@
 
               // All the items in the last column, except for the one* that
               // conflicts with the item we're trying to place, need to have
               // their span extended by 1, since we're adding the new column
               //
               // * Note that there can only be one, because we sorted our
               //   events by start time, so this event must start later than
               //   the start of any possible conflicts.
-              var lastColNum = colEndArray.length;
-              for (var mm in currentBlob) {
-                  var mmStart = currentBlob[mm].itemInfo.layoutStart;
-                  var mmEnd = currentBlob[mm].itemInfo.layoutEnd;
+              let lastColNum = colEndArray.length;
+              for (let mm in currentBlob) {
+                  let mmStart = currentBlob[mm].itemInfo.layoutStart;
+                  let mmEnd = currentBlob[mm].itemInfo.layoutEnd;
                   if (currentBlob[mm].startCol + currentBlob[mm].colSpan == lastColNum &&
                       mmEnd.compare(curItemInfo.layoutStart) != 1) {
                       currentBlob[mm] = {itemInfo: currentBlob[mm].itemInfo,
                                          startCol: currentBlob[mm].startCol,
                                          colSpan: currentBlob[mm].colSpan + 1};
                   }
               }
               currentBlob.push({itemInfo: curItemInfo,
@@ -1110,45 +1110,45 @@
           //                the blank time in between them
           //
           // * Note that 'equal width' isn't strictly correct.  If we're
           //   oriented differently, it will be height (and we'll have rows
           //   not columns).  What's more, in the 'specialSpan' case, the
           //   columns won't actually have the same size, but will only all
           //   be multiples of a common size.  See the note in the relayout
           //   function for more info on this (fairly rare) case.
-          var layers = [];
+          let layers = [];
 
           // When we start a new blob, move to a new set of layers
-          var layerOffset = 0;
-          for (var glob of aBlobs) {
-              var layerArray = [];
-              var layerCounter = 1;
-
-              for (var data of glob.blob) {
+          let layerOffset = 0;
+          for (let glob of aBlobs) {
+              let layerArray = [];
+              let layerCounter = 1;
+
+              for (let data of glob.blob) {
                   // from the item at hand we need to figure out on which
                   // layer and on which column it should go.
-                  var layerIndex;
-                  var specialSpan = null;
+                  let layerIndex;
+                  let specialSpan = null;
 
                   // each blob receives its own layer, that's the first part of the story. within
                   // a given blob we need to distribute the items on different layers depending on
                   // the number of columns each item spans. if each item just spans a single column
                   // the blob will cover *one* layer. if the blob contains items that span more than
                   // a single column, this blob will cover more than one layer. the algorithm places
                   // the items on the first layer in the case an item covers a single column. new layers
                   // are introduced based on the start column and number of spanning columns of an item.
                   if (data.colSpan != 1) {
-                      var index = glob.totalCols * data.colSpan + data.startCol;
+                      let index = glob.totalCols * data.colSpan + data.startCol;
                       layerIndex = layerArray[index];
                       if (!layerIndex) {
                           layerIndex = layerCounter++;
                           layerArray[index] = layerIndex;
                       }
-                      var offset = ((glob.totalCols - data.colSpan) % glob.totalCols);
+                      let offset = ((glob.totalCols - data.colSpan) % glob.totalCols);
                       if (offset != 0) {
                           specialSpan = data.colSpan / glob.totalCols;
                       }
                   } else {
                       layerIndex = 0;
                   }
                   layerIndex += layerOffset;
 
@@ -1160,26 +1160,26 @@
                   while (data.startCol >= layers[layerIndex].length) {
                       layers[layerIndex].push([]);
                       if (specialSpan) {
                           layers[layerIndex][layers[layerIndex].length - 1].specialSpan = 1 / glob.totalCols;
                       }
                   }
 
                   // we now retrieve the column from 'layerIndex' and 'startCol'.
-                  var col = layers[layerIndex][data.startCol];
+                  let col = layers[layerIndex][data.startCol];
                   if (specialSpan) {
                       col.specialSpan = specialSpan;
                   }
 
                   // take into account that items can span several days.
                   // that's why i'm clipping the start- and end-time to the
                   // timespan of this column.
-                  var start = data.itemInfo.layoutStart;
-                  var end = data.itemInfo.layoutEnd;
+                  let start = data.itemInfo.layoutStart;
+                  let end = data.itemInfo.layoutEnd;
                   if (start.year != this.date.year ||
                       start.month != this.date.month ||
                       start.day != this.date.day) {
                       start = start.clone();
                       start.resetTo(this.date.year,
                                     this.date.month,
                                     this.date.day,
                                     0, this.mStartMin, 0,
@@ -1190,17 +1190,17 @@
                       end.day != this.date.day) {
                       end = end.clone();
                       end.resetTo(this.date.year,
                                   this.date.month,
                                   this.date.day,
                                   0, this.mEndMin, 0,
                                   end.timezone);
                   }
-                  var prevEnd;
+                  let prevEnd;
                   if (col.length > 0) {
                       // Fill in time gaps with a placeholder
                       prevEnd = col[col.length - 1].endDate.clone();
                   } else {
                       // First event in the column, add a placeholder for the
                       // blank time from this.mStartMin to the event's start
                       prevEnd = start.clone();
                       prevEnd.hour = 0;
@@ -1208,23 +1208,23 @@
                   }
                   prevEnd.timezone = floating();
                   // the reason why we need to calculate time durations
                   // based on floating timezones is that we need avoid
                   // dst gaps in this case. converting the date/times to
                   // floating conveys this idea in a natural way. note that
                   // we explicitly don't use getInTimezone() as it would
                   // be slightly more expensive in terms of performance.
-                  var floatstart = start.clone();
+                  let floatstart = start.clone();
                   floatstart.timezone = floating();
-                  var dur = floatstart.subtractDate(prevEnd);
+                  let dur = floatstart.subtractDate(prevEnd);
                   if (dur.inSeconds) {
                       col.push({duration: dur});
                   }
-                  var floatend = end.clone();
+                  let floatend = end.clone();
                   floatend.timezone = floating();
                   col.push({event: data.itemInfo.event,
                             endDate: end,
                             startDate: start,
                             duration: floatend.subtractDate(floatstart)});
               }
               layerOffset = layers.length;
           }
@@ -1638,43 +1638,43 @@
           window.removeEventListener("mouseup", col.onEventSweepMouseUp, false);
           window.removeEventListener("keypress", col.onEventSweepKeypress, false);
 
           document.calendarEventColumnDragging = null;
 
           // if the user didn't sweep out at least a few pixels, ignore
           // unless we're in a different column
           if (dragState.origColumn == col) {
-              var ignore = false;
+              let ignore = false;
               if (col.getAttribute("orient") == "vertical") {
                   if (Math.abs(event.screenY - dragState.origLoc) < 3) {
                       ignore = true;
                   }
               } else {
                   if (Math.abs(event.screenX - dragState.origLoc) < 3) {
                       ignore = true;
                   }
               }
 
               if (ignore) {
                   col.mDragState = null;
                   return;
               }
           }
 
-          var newStart;
-          var newEnd;
-          var startTZ;
-          var endTZ;
+          let newStart;
+          let newEnd;
+          let startTZ;
+          let endTZ;
           let dragDay = col.mDate;
           if (dragState.dragType != "new") {
-              var oldStart = dragState.dragOccurrence.startDate ||
+              let oldStart = dragState.dragOccurrence.startDate ||
                              dragState.dragOccurrence.entryDate ||
                              dragState.dragOccurrence.dueDate;
-              var oldEnd = dragState.dragOccurrence.endDate ||
+              let oldEnd = dragState.dragOccurrence.endDate ||
                            dragState.dragOccurrence.dueDate ||
                            dragState.dragOccurrence.entryDate;
               newStart = oldStart.clone();
               newEnd = oldEnd.clone();
 
               // Our views are pegged to the default timezone.  If the event
               // isn't also in the timezone, we're going to need to do some
               // tweaking. We could just do this for every event but
@@ -1943,28 +1943,28 @@
           if (!this.mDragState) {
               return;
           }
 
           let firstColumn = (aFirstColumn || this);
           let lastColumn = (aLastColumn || this);
           let realstartmin = this.mDragState.startMin + this.mStartMin;
           let realendmin = this.mDragState.endMin + this.mStartMin;
-          var starthr = Math.floor(realstartmin / 60);
-          var startmin = realstartmin % 60;
-
-          var endhr = Math.floor(realendmin / 60);
-          var endmin = realendmin % 60;
-
-          var formatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
+          let starthr = Math.floor(realstartmin / 60);
+          let startmin = realstartmin % 60;
+
+          let endhr = Math.floor(realendmin / 60);
+          let endmin = realendmin % 60;
+
+          let formatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
                           getService(Components.interfaces.nsIScriptableDateFormat);
-          var startstr = formatter.FormatTime("",
+          let startstr = formatter.FormatTime("",
                                               Components.interfaces.nsIScriptableDateFormat.timeFormatNoSeconds,
                                               starthr, startmin, 0);
-          var endstr = formatter.FormatTime("",
+          let endstr = formatter.FormatTime("",
                                             Components.interfaces.nsIScriptableDateFormat.timeFormatNoSeconds,
                                             endhr, endmin, 0);
 
           // Tasks without Entry or Due date have a string as first label
           // instead of the time.
           if (cal.isToDo(this.mDragState.dragOccurrence)) {
               if (!this.mDragState.dragOccurrence.dueDate) {
                   startstr = calGetString("calendar", "dragLabelTasksWithOnlyEntryDate");
@@ -2113,17 +2113,17 @@
         <setter><![CDATA[
           this.mDate = val;
           return val;
         ]]></setter>
       </property>
       <method name="findBoxForItem">
         <parameter name="aItem"/>
         <body><![CDATA[
-          for (var item of this.mItemBoxes) {
+          for (let item of this.mItemBoxes) {
               if (aItem && item.occurrence.hasSameIds(aItem)) {
                   // We can return directly, since there will only be one box per
                   // item in the header.
                   return item;
               }
           }
           return null;
         ]]></body>
@@ -2132,37 +2132,37 @@
       <method name="addEvent">
         <parameter name="aItem"/>
         <body><![CDATA[
           // prevent same items being added
           if (this.mItemBoxes.some(itemBox => itemBox.occurrence.hashId == aItem.hashId)) {
             return;
           }
 
-          var itemBox = createXULElement("calendar-editable-item");
+          let itemBox = createXULElement("calendar-editable-item");
           this.appendChild(itemBox);
           itemBox.calendarView = this.calendarView;
           itemBox.occurrence = aItem;
-          var ctxt = this.calendarView.getAttribute("item-context") ||
+          let ctxt = this.calendarView.getAttribute("item-context") ||
                      this.calendarView.getAttribute("context");
           itemBox.setAttribute("context", ctxt);
 
           if (aItem.hashId in this.calendarView.mFlashingEvents) {
             itemBox.setAttribute("flashing", "true");
           }
 
           this.mItemBoxes.push(itemBox);
           itemBox.parentBox = this;
         ]]></body>
       </method>
 
       <method name="deleteEvent">
         <parameter name="aItem"/>
         <body><![CDATA[
-          for (var i in this.mItemBoxes) {
+          for (let i in this.mItemBoxes) {
             if (this.mItemBoxes[i].occurrence.hashId == aItem.hashId) {
               this.mItemBoxes[i].remove();
               this.mItemBoxes.splice(i, 1);
               break;
             }
           }
         ]]></body>
       </method>
@@ -2308,97 +2308,97 @@
       <!-- fields -->
       <field name="mParentColumn">null</field>
 
       <!-- methods/properties -->
       <method name="setAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
         <body><![CDATA[
-          var needsrelayout = false;
+          let needsrelayout = false;
           if (aAttr == "orient") {
               if (this.getAttribute("orient") != aVal) {
                   needsrelayout = true;
               }
           }
 
           // this should be done using lookupMethod(), see bug 286629
-          var ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
+          let ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
 
           if (needsrelayout) {
-              var otherorient = (val == "vertical" ? "horizontal" : "vertical");
-              var eventbox = document.getAnonymousElementByAttribute(this, "anonid", "eventbox");
+              let otherorient = (val == "vertical" ? "horizontal" : "vertical");
+              let eventbox = document.getAnonymousElementByAttribute(this, "anonid", "eventbox");
               eventbox.setAttribute("orient", val);
-              var gb1 = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1");
+              let gb1 = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1");
               gb1.parentorient = val;
-              var gb2 = document.getAnonymousElementByAttribute(this, "anonid", "gripbar2");
+              let gb2 = document.getAnonymousElementByAttribute(this, "anonid", "gripbar2");
               gb2.parentorient = val;
           }
 
           return ret;
         ]]></body>
       </method>
 
       <method name="getOptimalMinSize">
         <body><![CDATA[
           if (this.getAttribute("orient") == "vertical") {
-              var minHeight = getOptimalMinimumHeight(this.eventNameLabel) +
+              let minHeight = getOptimalMinimumHeight(this.eventNameLabel) +
                               getSummarizedStyleValues(document.getAnonymousElementByAttribute(this, "anonid", "eventbox"), ["margin-bottom", "margin-top"]) +
                               getSummarizedStyleValues(this, ["border-bottom-width", "border-top-width"]);
               this.setAttribute("minheight", minHeight);
               this.setAttribute("minwidth", "1");
               return minHeight;
           } else {
               this.eventNameLabel.setAttribute("style", "min-width: 2em");
-              var minWidth = getOptimalMinimumWidth(this.eventNameLabel);
+              let minWidth = getOptimalMinimumWidth(this.eventNameLabel);
               this.setAttribute("minwidth", minWidth);
               this.setAttribute("minheight", "1");
               return minWidth;
           }
         ]]></body>
       </method>
 
       <property name="parentColumn"
         onget="return this.mParentColumn;"
         onset="return (this.mParentColumn = val);"/>
 
       <property name="startMinute" readonly="true">
         <getter><![CDATA[
             if (!this.mOccurrence) {
                 return 0;
             }
-            var startDate = this.mOccurrence.startDate || this.mOccurrence.entryDate;
+            let startDate = this.mOccurrence.startDate || this.mOccurrence.entryDate;
             return startDate.hour * 60 + startDate.minute;
         ]]></getter>
       </property>
 
       <property name="endMinute" readonly="true">
         <getter><![CDATA[
             if (!this.mOccurrence) {
                 return 0;
             }
-            var endDate = this.mOccurrence.endDate || this.mOccurrence.dueDate;
+            let endDate = this.mOccurrence.endDate || this.mOccurrence.dueDate;
             return endDate.hour * 60 + endDate.minute;
         ]]></getter>
       </property>
 
       <method name="setEditableLabel">
         <body><![CDATA[
-          var evl = this.eventNameLabel;
-          var item = this.mOccurrence;
+          let evl = this.eventNameLabel;
+          let item = this.mOccurrence;
 
           if (item.title && item.title != "") {
             // Use <description> textContent so it can wrap.
             evl.textContent = item.title;
           } else {
             evl.textContent = calGetString("calendar", "eventUntitled");
           }
 
-          var gripbar = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1").boxObject.height;
-          var height = document.getAnonymousElementByAttribute(this, "anonid", "eventbox").boxObject.height;
+          let gripbar = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1").boxObject.height;
+          let height = document.getAnonymousElementByAttribute(this, "anonid", "eventbox").boxObject.height;
           evl.setAttribute("style", "max-height: " + Math.max(0, height-gripbar * 2) + "px");
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="mousedown" button="0"><![CDATA[
         event.stopPropagation();
@@ -2432,18 +2432,18 @@
         }
       ]]></handler>
 
       <handler event="mousemove"><![CDATA[
         if (!this.mInMouseDown) {
             return;
         }
 
-        var dx = Math.abs(event.screenX - this.mMouseX);
-        var dy = Math.abs(event.screenY - this.mMouseY);
+        let dx = Math.abs(event.screenX - this.mMouseX);
+        let dy = Math.abs(event.screenY - this.mMouseY);
         // more than a 3 pixel move?
         if ((dx * dx + dy * dy) > 9) {
             if (this.parentColumn) {
                 if (this.editingTimer) {
                     clearTimeout(this.editingTimer);
                     this.editingTimer = null;
                 }
 
@@ -2527,17 +2527,17 @@
 
         // initially scroll to the day start hour in the view
         this.scrollToMinute(this.mDayStartMin);
 
         // get visible hours from prefs and set on the view
         let visibleMinutes = Preferences.get("calendar.view.visiblehours", 9) * 60;
         this.setVisibleMinutes(visibleMinutes);
 
-        var self = this;
+        let self = this;
         // set the flex attribute at the scrollbox-innerbox
         // (this can be removed, after Bug 343555 is fixed)
         let scrollbox = document.getAnonymousElementByAttribute(
                        this, "anonid", "scrollbox");
         document.getAnonymousElementByAttribute(
             scrollbox, "class", "box-inherit scrollbox-innerbox").flex = "1";
 
         // set the time interval for the time indicator timer
@@ -2743,18 +2743,18 @@
       <field name="mTimeIndicatorInterval">15</field>
       <field name="mModeHandler">null</field>
       <field name="mTimeIndicatorMinutes">0</field>
 
       <method name="flashAlarm">
         <parameter name="aAlarmItem"/>
         <parameter name="aStop"/>
         <body><![CDATA[
-          var showIndicator = Preferences.get("calendar.alarms.indicator.show", true);
-          var totaltime = Preferences.get("calendar.alarms.indicator.totaltime", 3600);
+          let showIndicator = Preferences.get("calendar.alarms.indicator.show", true);
+          let totaltime = Preferences.get("calendar.alarms.indicator.totaltime", 3600);
 
           if (!aStop && (!showIndicator || totaltime < 1)) {
             // No need to animate if the indicator should not be shown.
             return;
           }
 
           // Helper function to save some duplicate code
           function setFlashingAttribute(aBox) {
@@ -2762,31 +2762,31 @@
               aBox.removeAttribute("flashing");
             } else {
               aBox.setAttribute("flashing", "true");
             }
           }
 
           // Make sure the flashing attribute is set or reset on all visible
           // boxes.
-          var columns = this.findColumnsForItem(aAlarmItem);
-          for (var col of columns) {
-            var box = col.column.findChunkForOccurrence(aAlarmItem);
+          let columns = this.findColumnsForItem(aAlarmItem);
+          for (let col of columns) {
+            let box = col.column.findChunkForOccurrence(aAlarmItem);
             if (box && box.eventbox) {
               setFlashingAttribute(box.eventbox);
             }
             box = col.header.findBoxForItem(aAlarmItem);
             if (box) {
               setFlashingAttribute(box);
             }
           }
 
           if (!aStop) {
             // Set up a timer to stop the flashing after the total time.
-            var this_ = this;
+            let this_ = this;
             this.mFlashingEvents[aAlarmItem.hashId] = aAlarmItem;
             setTimeout(function() { this_.flashAlarm(aAlarmItem, true); }, totaltime);
           } else {
             // We are done flashing, prevent newly created event boxes from flashing.
             delete this.mFlashingEvents[aAlarmItem.hashId];
           }
         ]]></body>
       </method>
@@ -2819,26 +2819,26 @@
               return null;
           }
         ]]></getter>
       </property>
 
       <method name="showDate">
         <parameter name="aDate"/>
         <body><![CDATA[
-          var targetDate = aDate.getInTimezone(this.mTimezone);
+          let targetDate = aDate.getInTimezone(this.mTimezone);
           targetDate.isDate = true;
 
           if (this.mStartDate && this.mEndDate) {
               if (this.mStartDate.compare(targetDate) <= 0 &&
                   this.mEndDate.compare(targetDate) >= 0) {
                   return;
               }
           } else if (this.mDateList) {
-              for (var d of this.mDateList) {
+              for (let d of this.mDateList) {
                   // if date is already visible, nothing to do
                   if (d.compare(targetDate) == 0) {
                       return;
                   }
               }
           }
 
           // if we're only showing one date, then continue
@@ -2934,17 +2934,17 @@
         ]]></getter>
         <setter><![CDATA[
             this.mClickedTime = val;
         ]]></setter>
       </property>
 
       <property name="selectedDay">
         <getter><![CDATA[
-          var selected;
+          let selected;
           if (this.numVisibleDates == 1) {
               selected = this.mDateColumns[0].date;
           } else if (this.mSelectedDay) {
               selected = this.mSelectedDay;
           } else if (this.mSelectedDayCol) {
               selected = this.mSelectedDayCol.date;
           }
 
@@ -2970,17 +2970,17 @@
             if (this.mSelectedDayCol) {
               this.mSelectedDay = this.mSelectedDayCol.date;
               this.mSelectedDayCol.column.selected = true;
               this.mSelectedDayCol.header.setAttribute("selected", "true");
             } else {
               this.mSelectedDay = val;
             }
           }
-          var headerColLabel = this.selectColumnHeader(val);
+          let headerColLabel = this.selectColumnHeader(val);
           this.fireEvent("dayselect", val);
           return val;
         ]]></setter>
       </property>
 
       <method name="getSelectedItems">
         <parameter name="aCount"/>
         <body><![CDATA[
@@ -3039,35 +3039,35 @@
           } else { // undated todo
               return [];
           }
         ]]></body>
       </method>
 
       <method name="centerSelectedItems">
         <body><![CDATA[
-          var displayTZ = calendarDefaultTimezone();
-          var lowMinute = 24 * 60;
-          var highMinute = 0;
-
-          for (var item of this.mSelectedItems) {
-              var startDateProperty = calGetStartDateProp(item);
-              var endDateProperty = calGetEndDateProp(item);
-
-              var occs = [];
+          let displayTZ = calendarDefaultTimezone();
+          let lowMinute = 24 * 60;
+          let highMinute = 0;
+
+          for (let item of this.mSelectedItems) {
+              let startDateProperty = calGetStartDateProp(item);
+              let endDateProperty = calGetEndDateProp(item);
+
+              let occs = [];
               if (item.recurrenceInfo) {
                   // if selected a parent item, show occurrence(s) in view range
                   occs = item.getOccurrencesBetween(this.startDate, this.queryEndDate, {}, 0);
               } else {
                   occs = [item];
               }
 
-              for (var occ of occs) {
-                  var occStart = occ[startDateProperty];
-                  var occEnd = occ[endDateProperty];
+              for (let occ of occs) {
+                  let occStart = occ[startDateProperty];
+                  let occEnd = occ[endDateProperty];
                   // must have at least one of start or end
                   if (!occStart && !occEnd) {
                       continue; // task with no dates
                   }
 
                   // if just has single datetime, treat as zero duration item
                   // (such as task with due datetime or start datetime only)
                   occStart = (occStart || occEnd);
@@ -3106,17 +3106,17 @@
                   // Ensure range shows occ
                   lowMinute = Math.min(occStart.hour * 60 + occStart.minute,
                                        lowMinute);
                   highMinute = Math.max(occEnd.hour * 60 + occEnd.minute,
                                         highMinute);
               }
           }
 
-          var displayDuration = highMinute - lowMinute;
+          let displayDuration = highMinute - lowMinute;
           if (this.mSelectedItems.length &&
               displayDuration >= 0) {
               let minute;
               if (displayDuration <= this.mVisibleMinutes) {
                   minute = lowMinute + (displayDuration - this.mVisibleMinutes) / 2;
               } else if (this.mSelectedItems.length == 1) {
                   // If the displayDuration doesn't fit into the visible
                   // minutes, but only one event is selected, then go ahead and
@@ -3152,24 +3152,24 @@
       <!-- private -->
 
       <property name="numVisibleDates" readonly="true">
         <getter><![CDATA[
           if (this.mDateList) {
             return this.mDateList.length;
           }
 
-          var count = 0;
+          let count = 0;
 
           if (!this.mStartDate || !this.mEndDate) {
             // The view has not been initialized, so there are 0 visible dates.
             return count;
           }
 
-          var d = this.mStartDate.clone();
+          let d = this.mStartDate.clone();
           while (d.compare(this.mEndDate) <= 0) {
             count++;
             d.day += 1;
           }
 
           return count;
         ]]></getter>
       </property>
@@ -3185,30 +3185,30 @@
           return document.getAnonymousElementByAttribute(timebar, "anonid", "timeIndicatorBoxTimeBar");
         ]]></getter>
       </property>
 
       <method name="setAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
         <body><![CDATA[
-          var needsreorient = false;
-          var needsrelayout = false;
+          let needsreorient = false;
+          let needsrelayout = false;
           if (aAttr == "orient") {
               if (this.getAttribute("orient") != aVal) {
                   needsreorient = true;
               }
           }
 
           if (aAttr == "context" || aAttr == "item-context") {
               needsrelayout = true;
           }
 
           // this should be done using lookupMethod(), see bug 286629
-          var ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
+          let ret = XULElement.prototype.setAttribute.call(this, aAttr, aVal);
 
           if (needsrelayout && !needsreorient) {
               this.relayout();
           }
 
           if (needsreorient) {
               this.reorient();
           }
@@ -3292,22 +3292,22 @@
           }
           this.mDateList = computedDateList;
 
           // unselect previous selected event upon switch views, otherwise those
           // events will stay selected forever, if select other events after
           // change week view.
           this.setSelectedItems(0, [], true);
 
-          var daybox = document.getAnonymousElementByAttribute(this, "anonid", "daybox");
-          var headerdaybox = document.getAnonymousElementByAttribute(this, "anonid", "headerdaybox");
-
-          var calView = this;
-          var dayStartMin = this.mDayStartMin;
-          var dayEndMin = this.mDayEndMin;
+          let daybox = document.getAnonymousElementByAttribute(this, "anonid", "daybox");
+          let headerdaybox = document.getAnonymousElementByAttribute(this, "anonid", "headerdaybox");
+
+          let calView = this;
+          let dayStartMin = this.mDayStartMin;
+          let dayEndMin = this.mDayEndMin;
           function setUpDayEventsBox(aDayBox, date) {
               aDayBox.setAttribute("class", "calendar-event-column-" + (counter % 2 == 0 ? "even" : "odd"));
               aDayBox.setAttribute("context", calView.getAttribute("context"));
               aDayBox.setAttribute("item-context", calView.getAttribute("item-context") || calView.getAttribute("context"));
               aDayBox.startLayoutBatchChange();
               aDayBox.date = date;
               aDayBox.setAttribute("orient", orient);
               aDayBox.calendarView = calView;
@@ -3323,60 +3323,60 @@
               // "rotated" in order to have different css rules.
               setBooleanAttribute(aDayBox, "rotated", orient == "horizontal");
           }
 
           this.mDateColumns = [];
 
 
           // get today's date
-          var today = this.today();
-          var counter = 0;
-          var dayboxkids = daybox.childNodes;
-          var headerboxkids = headerdaybox.childNodes;
+          let today = this.today();
+          let counter = 0;
+          let dayboxkids = daybox.childNodes;
+          let headerboxkids = headerdaybox.childNodes;
           let labelboxkids = this.labeldaybox.childNodes;
           let updateTimeIndicator = false;
 
-          for (var d of computedDateList) {
-              var dayEventsBox;
+          for (let d of computedDateList) {
+              let dayEventsBox;
               if (counter < dayboxkids.length) {
                   dayEventsBox = dayboxkids[counter];
                   dayEventsBox.removeAttribute("relation");
                   dayEventsBox.mEventInfos = [];
               } else {
                   dayEventsBox = createXULElement("calendar-event-column");
                   dayEventsBox.setAttribute("flex", "1");
                   daybox.appendChild(dayEventsBox);
               }
               setUpDayEventsBox(dayEventsBox, d);
 
-              var dayHeaderBox;
+              let dayHeaderBox;
               if (counter < headerboxkids.length) {
                   dayHeaderBox = headerboxkids[counter];
                   // Delete backwards to make sure we get them all
                   // and delete until no more elements are left.
                   while (dayHeaderBox.mItemBoxes.length != 0) {
-                      var num = dayHeaderBox.mItemBoxes.length;
+                      let num = dayHeaderBox.mItemBoxes.length;
                       dayHeaderBox.deleteEvent(dayHeaderBox.mItemBoxes[num-1].occurrence);
                   }
               } else {
                   dayHeaderBox = createXULElement("calendar-header-container");
                   dayHeaderBox.setAttribute("flex", "1");
                   headerdaybox.appendChild(dayHeaderBox);
               }
               setUpDayHeaderBox(dayHeaderBox, d);
 
               if (this.mDaysOffArray.indexOf(d.weekday) >= 0) {
                   dayEventsBox.dayOff = true;
                   dayHeaderBox.setAttribute("weekend", "true");
               } else {
                   dayEventsBox.dayOff = false;
                   dayHeaderBox.removeAttribute("weekend");
               }
-              var labelbox;
+              let labelbox;
               if (counter < labelboxkids.length) {
                   labelbox = labelboxkids[counter];
                   labelbox.date = d;
               } else {
                   labelbox = createXULElement("calendar-day-label");
                   labelbox.setAttribute("orient", otherorient);
                   this.labeldaybox.appendChild(labelbox);
                   labelbox.date = d;
@@ -3413,17 +3413,17 @@
                   case 1:
                       dayHeaderBox.setAttribute("relation", "future");
                       dayEventsBox.setAttribute("relation", "future");
                       labelbox.setAttribute("relation", "future");
                       break;
               }
               // We don't want to actually mess with our original dates, plus
               // they're likely to be immutable.
-              var d2 = d.clone();
+              let d2 = d.clone();
               d2.isDate = true;
               d2.makeImmutable();
               this.mDateColumns.push({ date: d2, column: dayEventsBox, header: dayHeaderBox });
               counter++;
           }
 
           // Remove any extra columns that may have been hanging around
           function removeExtraKids(elem) {
@@ -3473,17 +3473,17 @@
       </method>
 
       <method name="findColumnForDate">
         <parameter name="aDate"/>
         <body><![CDATA[
           if (!this.mDateColumns) {
               return null;
           }
-          for (var col of this.mDateColumns) {
+          for (let col of this.mDateColumns) {
               if (col.date.compare(aDate) == 0) {
                   return col;
               }
           }
           return null;
         ]]></body>
       </method>
 
@@ -3512,25 +3512,25 @@
 
       <method name="findColumnsForOccurrences">
         <parameter name="aOccurrences"/>
         <body><![CDATA[
           if (!this.mDateColumns || !this.mDateColumns.length) {
             return [];
           }
 
-          var occMap = {};
-          for (var occ of aOccurrences) {
-              var startDate = occ[calGetStartDateProp(occ)]
+          let occMap = {};
+          for (let occ of aOccurrences) {
+              let startDate = occ[calGetStartDateProp(occ)]
                               .getInTimezone(this.mStartDate.timezone);
-              var endDate = occ[calGetEndDateProp(occ)]
+              let endDate = occ[calGetEndDateProp(occ)]
                               .getInTimezone(this.mEndDate.timezone) || startDate;
               if (startDate.compare(this.mStartDate) >= 0 &&
                   endDate.compare(this.mEndDate) <= 0) {
-                  for (var i = startDate.day; i <= endDate.day; i++) {
+                  for (let i = startDate.day; i <= endDate.day; i++) {
                       occMap[i] = true;
                   }
               }
           }
 
           return this.mDateColumns.filter(function(col) {
               return (col.date.day in occMap);
           });
@@ -3592,45 +3592,45 @@
         -->
       <method name="findColumnForClientPoint">
         <parameter name="aClientX"/>
         <parameter name="aClientY"/>
         <body><![CDATA[
           if (!this.mDateColumns) {
               return null;
           }
-          for (var col of this.mDateColumns) {
+          for (let col of this.mDateColumns) {
               let bo = document.getAnonymousElementByAttribute(col.column, "anonid", "boxstack").boxObject;
               if ((aClientX >= bo.screenX) && (aClientX <= (bo.screenX + bo.width)) &&
                   (aClientY >= bo.screenY) && (aClientY <= (bo.screenY + bo.height))) {
                   return col.column;
               }
           }
           return null;
         ]]></body>
       </method>
 
       <method name="adjustScrollbarSpacersForAlldayEvents">
         <parameter name="aEvent"/>
         <body><![CDATA[
-          var startDate = aEvent[calGetStartDateProp(aEvent)];
-          var endDate = aEvent[calGetEndDateProp(aEvent)];
+          let startDate = aEvent[calGetStartDateProp(aEvent)];
+          let endDate = aEvent[calGetEndDateProp(aEvent)];
           if (startDate && startDate.isDate ||
               endDate && endDate.isDate) {
               // If this is an all day event, then the header with allday
               // events could possibly get a scrollbar. Readjust them.
               this.adjustScrollBarSpacers();
           }
         ]]></body>
       </method>
 
       <method name="doAddItem">
         <parameter name="aEvent"/>
         <body><![CDATA[
-          var cols = this.findColumnsForItem(aEvent);
+          let cols = this.findColumnsForItem(aEvent);
           if (!cols.length) {
               return;
           }
 
           for (let col of cols) {
               let column = col.column;
               let header = col.header;
 
@@ -3644,22 +3644,22 @@
 
           this.adjustScrollbarSpacersForAlldayEvents(aEvent);
         ]]></body>
       </method>
 
       <method name="doDeleteItem">
         <parameter name="aEvent"/>
         <body><![CDATA[
-          var cols = this.findColumnsForItem(aEvent);
+          let cols = this.findColumnsForItem(aEvent);
           if (!cols.length) {
               return;
           }
 
-          var oldLength = this.mSelectedItems.length;
+          let oldLength = this.mSelectedItems.length;
           this.mSelectedItems = this.mSelectedItems.filter((item) => {
               return item.hashId != aEvent.hashId;
           });
 
           for (let col of cols) {
               let column = col.column;
               let header = col.header;
 
@@ -3699,51 +3699,51 @@
               }
           }
         ]]></body>
       </method>
 
       <method name="adjustScrollBarSpacers">
         <body><![CDATA[
           // get the view's orientation
-          var propertyName;
+          let propertyName;
           if (this.getAttribute("orient") == "vertical") {
               propertyName = "width";
           } else {
               propertyName = "height";
           }
 
           // get the width/height of the scrollbox scrollbar
-          var scrollbox = document.getAnonymousElementByAttribute(
+          let scrollbox = document.getAnonymousElementByAttribute(
                          this, "anonid", "scrollbox");
-          var propertyValue = scrollbox.boxObject.firstChild
+          let propertyValue = scrollbox.boxObject.firstChild
                               .boxObject[propertyName];
           // Check if we need to show the headerScrollbarSpacer at all
-          var headerPropertyValue = propertyValue;
-          var headerDayBox = document.getAnonymousElementByAttribute(
+          let headerPropertyValue = propertyValue;
+          let headerDayBox = document.getAnonymousElementByAttribute(
                              this, "anonid", "headerdaybox");
           if (headerDayBox) {
             // Only do this when there are multiple days
-            var headerDayBoxMaxHeight = parseInt(document.defaultView.getComputedStyle(headerDayBox, null)
+            let headerDayBoxMaxHeight = parseInt(document.defaultView.getComputedStyle(headerDayBox, null)
                                                          .getPropertyValue("max-height"), 10);
             if (this.getAttribute("orient") == "vertical" &&
                 headerDayBox.boxObject.height >= headerDayBoxMaxHeight) {
                 // If the headerDayBox is just as high as the max-height, then
                 // there is already a scrollbar and we don't need to show the
                 // headerScrollbarSpacer. This is only valid for the non-rotated
                 // view.
                 headerPropertyValue = 0;
             }
           }
 
           // set the same width/height for the label and header box spacers
-          var headerScrollBarSpacer = document.getAnonymousElementByAttribute(
+          let headerScrollBarSpacer = document.getAnonymousElementByAttribute(
                                       this, "anonid", "headerscrollbarspacer");
           headerScrollBarSpacer.setAttribute(propertyName, headerPropertyValue);
-          var labelScrollBarSpacer = document.getAnonymousElementByAttribute(
+          let labelScrollBarSpacer = document.getAnonymousElementByAttribute(
                                      this, "anonid", "labelscrollbarspacer");
           labelScrollBarSpacer.setAttribute(propertyName, propertyValue);
         ]]></body>
       </method>
 
       <field name="mFirstVisibleMinute">0</field>
       <method name="scrollToMinute">
         <parameter name="aMinute"/>
--- a/calendar/base/content/calendar-statusbar.js
+++ b/calendar/base/content/calendar-statusbar.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 /**
  * This code might change soon if we support Thunderbird's activity manager.
  * NOTE: The naming "Meteors" is historical.
  */
- var gCalendarStatusFeedback = {
+ let gCalendarStatusFeedback = {
      mCalendarStep: 0,
      mCalendarCount: 0,
      mWindow: null,
      mStatusText: null,
      mStatusBar: null,
      mStatusProgressPanel: null,
      mThrobber: null,
      mProgressMode: Components.interfaces.calIStatusObserver.NO_PROGRESS,
@@ -55,17 +55,17 @@ Components.utils.import("resource://gre/
                  this.mCalendarStep = Math.trunc(100 / this.mCalendarCount);
              }
              this.mProgressMode = aProgressMode;
              this.mStatusProgressPanel.removeAttribute("collapsed");
              if (this.mProgressMode == Components.interfaces.calIStatusObserver.DETERMINED_PROGRESS) {
                  this.mStatusBar.removeAttribute("collapsed");
                  this.mStatusBar.setAttribute("mode", "determined");
                  this.mStatusBar.value = 0;
-                 var commonStatus = calGetString("calendar", "gettingCalendarInfoCommon");
+                 let commonStatus = calGetString("calendar", "gettingCalendarInfoCommon");
                  this.showStatusString(commonStatus);
              }
              if (this.mThrobber) {
                  this.mThrobber.setAttribute("busy", true);
              }
          }
      },
 
--- a/calendar/base/content/calendar-task-editing.js
+++ b/calendar/base/content/calendar-task-editing.js
@@ -54,24 +54,24 @@ var taskEdit = {
     },
 
     /**
      * Handler function to call when the quick-add textbox gains focus.
      *
      * @param aEvent    The DOM focus event
      */
     onFocus: function tE_onFocus(aEvent) {
-        var edit = aEvent.target;
+        let edit = aEvent.target;
         if (edit.localName == "input") {
             // For some reason, we only receive an onfocus event for the textbox
             // when debugging with venkman.
             edit = edit.parentNode.parentNode;
         }
 
-        var calendar = getSelectedCalendar();
+        let calendar = getSelectedCalendar();
         edit.showsInstructions = true;
 
         if (calendar.getProperty("capabilities.tasks.supported") === false) {
             taskEdit.setupTaskField(edit,
                                     true,
                                     calGetString("calendar", "taskEditInstructionsCapability"));
         } else if (!isCalendarWritable(calendar)) {
             taskEdit.setupTaskField(edit,
@@ -143,18 +143,18 @@ var taskEdit = {
 
     /**
      * Window load function to set up all quick-add textboxes. The texbox must
      * have the class "task-edit-field".
      */
     onLoad: function tE_onLoad(aEvent) {
         window.removeEventListener("load", taskEdit.onLoad, false);
         // TODO use getElementsByClassName
-        var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
-        for (var i = 0; i < taskEditFields.length; i++) {
+        let taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+        for (let i = 0; i < taskEditFields.length; i++) {
             taskEdit.onBlur({ target: taskEditFields[i] });
         }
 
         getCompositeCalendar().addObserver(taskEdit.compositeObserver);
         taskEdit.observedCalendar = getSelectedCalendar();
     },
 
     /**
@@ -190,18 +190,18 @@ var taskEdit = {
             if (aCalendar.id != getSelectedCalendar().id) {
                 // Optimization: if the given calendar isn't the default calendar,
                 // then we don't need to change any readonly/disabled states.
                 return;
             }
             switch (aName) {
                 case "readOnly":
                 case "disabled":
-                    var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
-                    for (var i = 0; i < taskEditFields.length; i++) {
+                    let taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+                    for (let i = 0; i < taskEditFields.length; i++) {
                         taskEdit.onBlur({ target: taskEditFields[i] });
                     }
             }
         },
 
         onPropertyDeleting: function tE_calObs_onPropertyDeleting(aCalendar,
                                                            aName) {
             // Since the old value is not used directly in onPropertyChanged,
@@ -234,18 +234,18 @@ var taskEdit = {
         onError: function(aCalendar, aErrNo, aMessage) {},
         onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {},
         onPropertyDeleting: function(aCalendar, aName) {},
 
         // calICompositeObserver:
         onCalendarAdded: function onCalendarAdded(aCalendar) {},
         onCalendarRemoved: function onCalendarRemoved(aCalendar) {},
         onDefaultCalendarChanged: function tE_compObs_onDefaultCalendarChanged(aNewDefault) {
-            var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
-            for (var i = 0; i < taskEditFields.length; i++) {
+            let taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+            for (let i = 0; i < taskEditFields.length; i++) {
                 taskEdit.onBlur({ target: taskEditFields[i] });
             }
             taskEdit.observedCalendar = aNewDefault;
         }
     }
 };
 
 window.addEventListener("load", taskEdit.onLoad, false);
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -7,25 +7,25 @@
  * children.
  *
  * XXX Either replace the existing items using replaceNode, or use helper
  * functions (cal.removeChildren).
  *
  * @param aEvent    The popupshowing event of the opening menu
  */
 function addCalendarNames(aEvent) {
-    var calendarMenuPopup = aEvent.target;
-    var calendars = getCalendarManager().getCalendars({});
+    let calendarMenuPopup = aEvent.target;
+    let calendars = getCalendarManager().getCalendars({});
     while (calendarMenuPopup.hasChildNodes()) {
         calendarMenuPopup.lastChild.remove();
     }
-    var tasks = getSelectedTasks(aEvent);
-    var tasksSelected = (tasks.length > 0);
+    let tasks = getSelectedTasks(aEvent);
+    let tasksSelected = (tasks.length > 0);
     if (tasksSelected) {
-        var selIndex = appendCalendarItems(tasks[0], calendarMenuPopup, null, "contextChangeTaskCalendar(event);");
+        let selIndex = appendCalendarItems(tasks[0], calendarMenuPopup, null, "contextChangeTaskCalendar(event);");
         if (isPropertyValueSame(tasks, "calendar") && (selIndex > -1)) {
             calendarMenuPopup.childNodes[selIndex].setAttribute("checked", "true");
         }
     }
 }
 
 /**
  * Change the opening context menu for the selected tasks.
@@ -151,20 +151,20 @@ function contextChangeTaskProgress(aEven
 /**
  * Handler function to change the calendar of the selected tasks. The targeted
  * menuitem must have "calendar" property that implements calICalendar.
  *
  * @param aEvent      The DOM event that triggered this command.
  */
 function contextChangeTaskCalendar(aEvent) {
    startBatchTransaction();
-   var tasks = getSelectedTasks(aEvent);
-   for (var t = 0; t < tasks.length; t++) {
-       var task = tasks[t];
-       var newTask = task.clone().QueryInterface(Components.interfaces.calITodo);
+   let tasks = getSelectedTasks(aEvent);
+   for (let t = 0; t < tasks.length; t++) {
+       let task = tasks[t];
+       let newTask = task.clone().QueryInterface(Components.interfaces.calITodo);
        newTask.calendar = aEvent.target.calendar;
        doTransaction('modify', newTask, newTask.calendar, task, null);
     }
     endBatchTransaction();
 }
 
 /**
  * Handler function to change the priority of the selected tasks, or of
@@ -174,17 +174,17 @@ function contextChangeTaskCalendar(aEven
  * @param {short} aPriority         The priority to set on the task(s)
  */
 function contextChangeTaskPriority(aEvent, aPriority) {
     let tabType = gTabmail && gTabmail.currentTabInfo.mode.type;
     if (tabType == "calendarTask" || tabType == "calendarEvent") {
         editConfigState({ priority: aPriority });
     } else {
         startBatchTransaction();
-        var tasks = getSelectedTasks(aEvent);
+        let tasks = getSelectedTasks(aEvent);
         for (let task of tasks) {
             let newTask = task.clone().QueryInterface(Components.interfaces.calITodo);
             newTask.priority = aPriority;
             doTransaction('modify', newTask, newTask.calendar, task, null);
         }
         endBatchTransaction();
     }
 }
@@ -226,80 +226,80 @@ function contextPostponeTask(aEvent, aDu
 
 /**
  * Modifies the selected tasks with the event dialog
  *
  * @param aEvent        The DOM event that triggered this command.
  * @param initialDate   (optional) The initial date for new task datepickers
  */
 function modifyTaskFromContext(aEvent, initialDate) {
-    var tasks = getSelectedTasks(aEvent);
-    for (var t = 0; t < tasks.length; t++) {
+    let tasks = getSelectedTasks(aEvent);
+    for (let t = 0; t < tasks.length; t++) {
         modifyEventWithDialog(tasks[t], null, true, initialDate);
     }
  }
 
 /**
  *  Delete the current selected item with focus from the task tree
  *
  * @param aEvent          The DOM event that triggered this command.
  * @param aDoNotConfirm   If true, the user will not be asked to delete.
  */
 function deleteToDoCommand(aEvent, aDoNotConfirm) {
-    var tasks = getSelectedTasks(aEvent);
+    let tasks = getSelectedTasks(aEvent);
     calendarViewController.deleteOccurrences(tasks.length,
                                              tasks,
                                              false,
                                              aDoNotConfirm);
 }
 
 /**
  * Gets the currently visible task tree
  *
  * @return    The XUL task tree element.
  */
 function getTaskTree() {
-    var currentMode = document.getElementById("modeBroadcaster").getAttribute("mode");
+    let currentMode = document.getElementById("modeBroadcaster").getAttribute("mode");
     if (currentMode == "task") {
         return document.getElementById("calendar-task-tree");
     } else {
         return document.getElementById("unifinder-todo-tree");
     }
 }
 
 /**
  * Gets the tasks selected in the currently visible task tree.
  *
  * XXX Parameter aEvent is unused, needs to be removed here and in calling
  * functions.
  *
  * @param aEvent      Unused
  */
 function getSelectedTasks(aEvent) {
-    var taskTree = getTaskTree();
+    let taskTree = getTaskTree();
     if (taskTree != null) {
         return taskTree.selectedTasks;
     } else {
         return [];
     }
 }
 
 /**
  * Convert selected tasks to emails.
  */
 function tasksToMail(aEvent) {
-    var tasks = getSelectedTasks(aEvent);
+    let tasks = getSelectedTasks(aEvent);
     calendarMailButtonDNDObserver.onDropItems(tasks);
 }
 
 /**
  * Convert selected tasks to events.
  */
 function tasksToEvents(aEvent) {
-    var tasks = getSelectedTasks(aEvent);
+    let tasks = getSelectedTasks(aEvent);
     calendarCalendarButtonDNDObserver.onDropItems(tasks);
 }
 
 /**
  * Toggle the completed state on selected tasks.
  *
  * @param aEvent    The originating event, can be null.
  */
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -223,17 +223,17 @@
       <field name="mFilter">null</field>
       <field name="mStartDate">null</field>
       <field name="mEndDate">null</field>
       <field name="mDateRangeFilter">null</field>
       <field name="mTextFilterField">null</field>
 
       <property name="currentIndex">
         <getter><![CDATA[
-          var tree = document.getAnonymousElementByAttribute(
+          let tree = document.getAnonymousElementByAttribute(
               this, "anonid", "calendar-task-tree");
           return tree.currentIndex;
         ]]></getter>
       </property>
 
       <property name="currentTask">
         <getter><![CDATA[
           let tree = document.getAnonymousElementByAttribute(
@@ -244,28 +244,28 @@
               index = (tree.view.selection.isSelected(index) ? index : -1);
           }
           return (index < 0) ? null : this.mTaskArray[index];
         ]]></getter>
       </property>
 
       <property name="selectedTasks" readonly="true">
         <getter><![CDATA[
-          var tasks = [];
-          var start = {};
-          var end = {};
+          let tasks = [];
+          let start = {};
+          let end = {};
           if (!this.mTreeView.selection) {
               return tasks;
           }
 
-          var rangeCount = this.mTreeView.selection.getRangeCount();
-          for (var range = 0; range < rangeCount; range++) {
+          let rangeCount = this.mTreeView.selection.getRangeCount();
+          for (let range = 0; range < rangeCount; range++) {
               this.mTreeView.selection.getRangeAt(range, start, end);
-              for (var i = start.value; i <= end.value; i++) {
-                  var task = this.getTaskAtRow(i);
+              for (let i = start.value; i <= end.value; i++) {
+                  let task = this.getTaskAtRow(i);
                   if (task) {
                       tasks.push(this.getTaskAtRow(i));
                   }
               }
           }
           return tasks;
         ]]></getter>
       </property>
@@ -353,20 +353,20 @@
           mSelectedColumn: null,
           sortDirection: null,
 
           get selectedColumn() {
               return this.mSelectedColumn;
           },
 
           set selectedColumn(aCol) {
-              var tree = document.getAnonymousNodes(this.binding)[0];
-              var treecols = tree.getElementsByTagNameNS(tree.namespaceURI, "treecol");
-              for (var i = 0; i < treecols.length; i++) {
-                  var col = treecols[i];
+              let tree = document.getAnonymousNodes(this.binding)[0];
+              let treecols = tree.getElementsByTagNameNS(tree.namespaceURI, "treecol");
+              for (let i = 0; i < treecols.length; i++) {
+                  let col = treecols[i];
                   if (col.getAttribute("sortActive")) {
                       col.removeAttribute("sortActive");
                       col.removeAttribute("sortDirection");
                   }
                   if (aCol.getAttribute("itemproperty") == col.getAttribute("itemproperty")) {
                       col.setAttribute("sortActive", "true");
                       col.setAttribute("sortDirection", this.sortDirection);
                   }
@@ -464,27 +464,27 @@
                   this.tree.view.selection.select(selIndex);
                   this.treebox.ensureRowIsVisible(selIndex);
               }
 
               this.treebox.endUpdateBatch();
           },
 
           clear: function tTV_clear() {
-              var count = this.binding.mTaskArray.length;
+              let count = this.binding.mTaskArray.length;
               if (count > 0) {
                   this.binding.mTaskArray = [];
                   this.binding.mHash2Index = {};
                   this.treebox.rowCountChanged(0, -count);
                   this.tree.view.selection.clearSelection();
               }
           },
 
           updateItem: function tTV_updateItem(aItem) {
-              var index = this.binding.mHash2Index[aItem.hashId];
+              let index = this.binding.mHash2Index[aItem.hashId];
               if (index) {
                   this.treebox.invalidateRow(index);
               }
           },
 
           /**
            * nsITreeView methods and properties
            */
@@ -538,27 +538,27 @@
                                                  .map(formatStringForCSSRule));
 
               return properties.join(" ");
           },
 
           // Called on the view when a cell in a non-selectable cycling
           // column (e.g., unread/flag/etc.) is clicked.
           cycleCell: function mTV_cycleCell(aRow, aCol) {
-              var task = this.binding.mTaskArray[aRow];
+              let task = this.binding.mTaskArray[aRow];
 
               // prevent toggling completed status for parent items of
               // repeating tasks or when the calendar is read-only.
               if (!task || task.recurrenceInfo || task.calendar.readOnly) {
                   return;
               }
               if (aCol != null) {
-                  var content = aCol.element.getAttribute("itemproperty");
+                  let content = aCol.element.getAttribute("itemproperty");
                   if (content == "completed") {
-                      var newTask = task.clone().QueryInterface(Components.interfaces.calITodo);
+                      let newTask = task.clone().QueryInterface(Components.interfaces.calITodo);
                       newTask.isCompleted = !task.completedDate;
                       doTransaction('modify', newTask, newTask.calendar, task, null);
                   }
               }
           },
 
           // Called on the view when a header is clicked.
           cycleHeader: function mTV_cycleHeader(aCol) {
@@ -579,17 +579,17 @@
                       this.tree.view.selection.toggleSelect(index);
                   }
               }
           },
 
           // The text for a given cell. If a column consists only of an
           // image, then the empty string is returned.
           getCellText: function mTV_getCellText(aRow, aCol) {
-              var task = this.binding.mTaskArray[aRow];
+              let task = this.binding.mTaskArray[aRow];
               if (!task) {
                   return false;
               }
 
               switch (aCol.element.getAttribute("itemproperty")) {
                   case "title":
                       // return title, or "Untitled" if empty/null
                       return (task.title ? task.title.replace(/\n/g, ' ') : calGetString("calendar", "eventUntitled"));
@@ -615,17 +615,17 @@
                   case "priority":
                   default:
                       return "";
               }
           },
 
           // This method is only called for columns of type other than text.
           getCellValue: function mTV_getCellValue(aRow, aCol) {
-              var task = this.binding.mTaskArray[aRow];
+              let task = this.binding.mTaskArray[aRow];
               if (!task) {
                   return null;
               }
               switch (aCol.element.getAttribute("itemproperty")) {
                   case "percentComplete":
                       return task.percentComplete;
               }
               return null;
@@ -705,17 +705,17 @@
               return null;
           },
 
           // The progress mode for a given cell. This method is only called for
           // columns of type |progressmeter|.
           getProgressMode: function mTV_getProgressMode(aRow, aCol) {
               switch (aCol.element.getAttribute("itemproperty")) {
                   case "percentComplete":
-                      var task = this.binding.mTaskArray[aRow];
+                      let task = this.binding.mTaskArray[aRow];
                       if (aCol.element.boxObject.width > 75 &&
                           task.percentComplete > 0) {
                           // XXX Would be nice if we could use relative widths,
                           // i.e "15ex", but there is no scriptable interface.
                           return Components.interfaces.nsITreeView.PROGRESS_NORMAL;
                       }
                       break;
               }
@@ -726,20 +726,20 @@
           /**
            * Task Tree Events
            */
           onSelect: function tTV_onSelect(event) {},
 
           onDoubleClick: function tTV_onDoubleClick(event) {
               if (event.button == 0) {
                   let initialDate = getDefaultStartDate(this.binding.getInitialDate());
-                  var col = {};
-                  var item = this._getItemFromEvent(event, col);
+                  let col = {};
+                  let item = this._getItemFromEvent(event, col);
                   if (item) {
-                      var colAnonId = col.value.element.getAttribute("itemproperty");
+                      let colAnonId = col.value.element.getAttribute("itemproperty");
                       if (colAnonId == "completed") {
                           // item holds checkbox state toggled by first click,
                           // so don't call modifyEventWithDialog
                           // to make sure user notices state changed.
                       } else {
                           modifyEventWithDialog(item, null, true, initialDate);
                       }
                   } else {
@@ -754,25 +754,25 @@
                   case kKE.DOM_VK_DELETE:
                       document.popupNode = this.binding;
                       document.getElementById('calendar_delete_todo_command').doCommand();
                       event.preventDefault();
                       event.stopPropagation();
                       break;
                   case kKE.DOM_VK_SPACE:
                       if (this.tree.currentIndex > -1) {
-                          var col = document.getAnonymousElementByAttribute(
+                          let col = document.getAnonymousElementByAttribute(
                               this.binding, "itemproperty", "completed");
                           this.cycleCell(
                               this.tree.currentIndex,
                               { element: col });
                       }
                       break;
                   case kKE.DOM_VK_RETURN:
-                      var index = this.tree.currentIndex;
+                      let index = this.tree.currentIndex;
                       if (index > -1) {
                           modifyEventWithDialog(this.binding.mTaskArray[index]);
                       }
                       break;
               }
           },
 
           // Set the context menu on mousedown to change it before it is opened
@@ -787,32 +787,32 @@
           },
 
           /**
            * Private methods and attributes
            */
 
           _getItemFromEvent: function tTV_getItemFromEvent(event, aCol, aRow) {
             aRow = aRow || {};
-            var childElt = {};
+            let childElt = {};
             this.treebox.getCellAt(event.clientX, event.clientY, aRow, aCol || {}, childElt);
             if (!childElt.value) {
                 return false;
             }
             return aRow && aRow.value > -1 && this.binding.mTaskArray[aRow.value];
           },
 
           // Helper function to display datetimes
           _formatDateTime: function tTV_formatDateTime(aDateTime) {
-              var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+              let dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
                                             .getService(Components.interfaces.calIDateTimeFormatter);
 
               // datetime is from todo object, it is not a javascript date
               if (aDateTime && aDateTime.isValid) {
-                  var dateTime = aDateTime.getInTimezone(calendarDefaultTimezone());
+                  let dateTime = aDateTime.getInTimezone(calendarDefaultTimezone());
                   return dateFormatter.formatDateTime(dateTime);
               }
               return "";
           }
       })
       ]]></field>
 
       <!--
@@ -848,17 +848,17 @@
           },
 
           onModifyItem: function tTO_onModifyItem(aNewItem, aOldItem) {
               if ((cal.isToDo(aNewItem) || cal.isToDo(aOldItem))) {
                   this.binding.mTreeView.modifyItems(this.binding.mFilter.getOccurrences(aNewItem),
                                                      this.binding.mFilter.getOccurrences(aOldItem));
 
                   // we also need to notify potential listeners.
-                  var event = document.createEvent('Events');
+                  let event = document.createEvent('Events');
                   event.initEvent('select', true, false);
                   this.binding.dispatchEvent(event);
               }
           },
 
           onDeleteItem: function tTO_onDeleteItem(aDeletedItem) {
               if (cal.isToDo(aDeletedItem)) {
                   this.binding.mTreeView.removeItems(this.binding.mFilter.getOccurrences(aDeletedItem));
@@ -1008,38 +1008,38 @@
             });
             this.mTreeView.removeItems(tasks);
         ]]></body>
       </method>
 
       <method name="sortItems">
         <body><![CDATA[
           if (this.mTreeView.selectedColumn) {
-              var modifier = (this.mTreeView.sortDirection == "descending" ? -1 : 1);
-              var sortKey = cal.sortEntry.mSortKey = this.mTreeView.selectedColumn.getAttribute("sortKey") ?
+              let modifier = (this.mTreeView.sortDirection == "descending" ? -1 : 1);
+              let sortKey = cal.sortEntry.mSortKey = this.mTreeView.selectedColumn.getAttribute("sortKey") ?
                           this.mTreeView.selectedColumn.getAttribute("sortKey") :
                           this.mTreeView.selectedColumn.getAttribute("itemproperty");
-              var sortType = cal.getSortTypeForSortKey(sortKey);
+              let sortType = cal.getSortTypeForSortKey(sortKey);
 
               // sort (key,item) entries
               cal.sortEntry.mSortStartedDate = now();
-              var entries = this.mTaskArray.map(cal.sortEntry, cal.sortEntry);
+              let entries = this.mTaskArray.map(cal.sortEntry, cal.sortEntry);
               entries.sort(cal.sortEntryComparer(sortType, modifier));
               this.mTaskArray = entries.map(cal.sortEntryItem);
           }
 
           this.recreateHashTable();
         ]]></body>
       </method>
 
       <method name="recreateHashTable">
         <body><![CDATA[
           this.mHash2Index = {};
-          for (var i=0; i < this.mTaskArray.length; i++) {
-              var item = this.mTaskArray[i];
+          for (let i = 0; i < this.mTaskArray.length; i++) {
+              let item = this.mTaskArray[i];
               this.mHash2Index[item.hashId] = i;
           }
           if (this.mTreeView.treebox) {
             this.mTreeView.treebox.invalidate();
           }
         ]]></body>
       </method>
 
@@ -1133,39 +1133,39 @@
       <handler event="mousedown"><![CDATA[
         this.mTreeView.onMouseDown(event);
       ]]></handler>
       <handler event="dragstart"><![CDATA[
         if (event.originalTarget.localName != "treechildren") {
             // We should only drag treechildren, not for example the scrollbar.
             return;
         }
-        var item = this.mTreeView._getItemFromEvent(event);
+        let item = this.mTreeView._getItemFromEvent(event);
         if (!item || item.calendar.readOnly) {
             return;
         }
 
-        var tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
+        let tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
 
         // let's build the drag region
-        var region = null;
+        let region = null;
         try {
           region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
           region.init();
-          var obo = tree.treeBoxObject;
-          var bo = obo.treeBody.boxObject;
-          var sel = tree.view.selection;
+          let obo = tree.treeBoxObject;
+          let bo = obo.treeBody.boxObject;
+          let sel = tree.view.selection;
 
-          var rowX = bo.x;
-          var rowY = bo.y;
-          var rowHeight = obo.rowHeight;
-          var rowWidth = bo.width;
+          let rowX = bo.x;
+          let rowY = bo.y;
+          let rowHeight = obo.rowHeight;
+          let rowWidth = bo.width;
 
           // add a rectangle for each visible selected row
-          for (var i = obo.getFirstVisibleRow(); i <= obo.getLastVisibleRow(); i++) {
+          for (let i = obo.getFirstVisibleRow(); i <= obo.getLastVisibleRow(); i++) {
             if (sel.isSelected(i)) {
               region.unionRect(rowX, rowY, rowWidth, rowHeight);
             }
             rowY = rowY + rowHeight;
           }
 
           // and finally, clip the result to be sure we don't spill over...
           if (!region.isEmpty()) {
--- a/calendar/base/content/calendar-task-view.js
+++ b/calendar/base/content/calendar-task-view.js
@@ -10,81 +10,81 @@ var taskDetailsView = {
 
     /**
      * Task Details Events
      *
      * XXXberend Please document this function, possibly also consolidate since
      * its the only function in taskDetailsView.
      */
     onSelect: function tDV_onSelect(event) {
-        var dateFormatter =
-            Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
-            .getService(Components.interfaces.calIDateTimeFormatter);
-
         function displayElement(id, flag) {
             setBooleanAttribute(id, "hidden", !flag);
             return flag;
         }
 
-        var item = document.getElementById("calendar-task-tree").currentTask;
+        let dateFormatter =
+            Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+            .getService(Components.interfaces.calIDateTimeFormatter);
+
+        let item = document.getElementById("calendar-task-tree").currentTask;
         if (displayElement("calendar-task-details-container", item != null) &&
             displayElement("calendar-task-view-splitter", item != null)) {
             displayElement("calendar-task-details-title-row", true);
             document.getElementById("calendar-task-details-title").textContent =
                 (item.title ? item.title.replace(/\n/g, ' ') : "");
 
-            var organizer = item.organizer;
+            let organizer = item.organizer;
             if (displayElement("calendar-task-details-organizer-row", organizer != null)) {
-                var name = organizer.commonName;
+                let name = organizer.commonName;
                 if (!name || name.length <= 0) {
                   if (organizer.id && organizer.id.length) {
                       name = organizer.id;
-                      var re = new RegExp("^mailto:(.*)", "i");
-                      var matches = re.exec(name);
+                      let re = new RegExp("^mailto:(.*)", "i");
+                      let matches = re.exec(name);
                       if (matches) {
                           name = matches[1];
                       }
                   }
                 }
                 if (displayElement("calendar-task-details-organizer-row", name && name.length)) {
                     document.getElementById("calendar-task-details-organizer").value = name;
                 }
             }
 
-            var priority = 0;
+            let priority = 0;
             if (item.calendar.getProperty("capabilities.priority.supported") != false) {
                 priority = parseInt(item.priority, 10);
             }
             displayElement("calendar-task-details-priority-label", (priority > 0));
             displayElement("calendar-task-details-priority-low", (priority >= 6 && priority <= 9));
             displayElement("calendar-task-details-priority-normal", priority == 5);
             displayElement("calendar-task-details-priority-high", (priority >= 1 && priority <= 4));
 
-            var status = item.getProperty("STATUS");
+            let status = item.getProperty("STATUS");
             if (displayElement("calendar-task-details-status-row", status && status.length > 0)) {
-                var statusDetails = document.getElementById("calendar-task-details-status");
+                let statusDetails = document.getElementById("calendar-task-details-status");
                 switch (status) {
                     case "NEEDS-ACTION":
                         statusDetails.value = calGetString(
                             "calendar",
                             "taskDetailsStatusNeedsAction");
                         break;
                     case "IN-PROCESS":
-                        var percent = 0;
-                        var property = item.getProperty("PERCENT-COMPLETE");
+                        let percent = 0;
+                        let property = item.getProperty("PERCENT-COMPLETE");
                         if (property != null) {
                             percent = parseInt(property, 10);
                         }
                         statusDetails.value = calGetString(
                             "calendar",
                             "taskDetailsStatusInProgress", [percent]);
                         break;
                     case "COMPLETED":
                         if (item.completedDate) {
-                            var completedDate = item.completedDate.getInTimezone(
+                            let completedDate = item.completedDate.getInTimezone(
                                                     calendarDefaultTimezone());
                             statusDetails.value = calGetString(
                                 "calendar",
                                 "taskDetailsStatusCompletedOn",
                                 [dateFormatter.formatDateTime(completedDate)]);
                         }
                         break;
                     case "CANCELLED":
@@ -92,41 +92,41 @@ var taskDetailsView = {
                             "calendar",
                             "taskDetailsStatusCancelled");
                         break;
                     default:
                         displayElement("calendar-task-details-status-row", false);
                         break;
                 }
             }
-            var categories = item.getCategories({});
+            let categories = item.getCategories({});
             if (displayElement("calendar-task-details-category-row", categories.length > 0)) {
                 document.getElementById("calendar-task-details-category").value = categories.join(", ");
             }
             document.getElementById("task-start-row").Item = item;
             document.getElementById("task-due-row").Item = item;
-            var parentItem = item;
+            let parentItem = item;
             if (parentItem.parentItem != parentItem) {
                 // XXXdbo Didn't we want to get rid of these checks?
                 parentItem = parentItem.parentItem;
             }
-            var recurrenceInfo = parentItem.recurrenceInfo;
-            var recurStart = parentItem.recurrenceStartDate;
+            let recurrenceInfo = parentItem.recurrenceInfo;
+            let recurStart = parentItem.recurrenceStartDate;
             if (displayElement("calendar-task-details-repeat-row", recurrenceInfo && recurStart)) {
-                var kDefaultTimezone = calendarDefaultTimezone();
-                var startDate = recurStart.getInTimezone(kDefaultTimezone);
-                var endDate = item.dueDate ? item.dueDate.getInTimezone(kDefaultTimezone) : null;
-                var detailsString = recurrenceRule2String(recurrenceInfo, startDate, endDate, startDate.isDate);
+                let kDefaultTimezone = calendarDefaultTimezone();
+                let startDate = recurStart.getInTimezone(kDefaultTimezone);
+                let endDate = item.dueDate ? item.dueDate.getInTimezone(kDefaultTimezone) : null;
+                let detailsString = recurrenceRule2String(recurrenceInfo, startDate, endDate, startDate.isDate);
                 if (detailsString) {
                     let rpv = document.getElementById("calendar-task-details-repeat");
                     rpv.value = detailsString.split("\n").join(" ");
                 }
             }
-            var textbox = document.getElementById("calendar-task-details-description");
-            var description = item.hasProperty("DESCRIPTION") ? item.getProperty("DESCRIPTION") : null;
+            let textbox = document.getElementById("calendar-task-details-description");
+            let description = item.hasProperty("DESCRIPTION") ? item.getProperty("DESCRIPTION") : null;
             textbox.value = description;
             textbox.inputField.readOnly = true;
             let attachmentRows = document.getElementById("calendar-task-details-attachment-rows");
             removeChildren(attachmentRows);
             let attachments = item.getAttachments({});
             if (displayElement("calendar-task-details-attachment-row", attachments.length > 0)) {
                 displayElement("calendar-task-details-attachment-rows", true);
                 for (let attachment of attachments) {
@@ -205,17 +205,17 @@ function taskViewUpdate(aFilter) {
 /**
  * Prepares a dialog to send an email to the organizer of the currently selected
  * task in the task view.
  *
  * XXX We already have a function with this name in the event dialog. Either
  * consolidate or make name more clear.
  */
 function sendMailToOrganizer() {
-    var item = document.getElementById("calendar-task-tree").currentTask;
+    let item = document.getElementById("calendar-task-tree").currentTask;
     if (item != null) {
         let organizer = item.organizer;
         let email = cal.getAttendeeEmail(organizer, true);
         let emailSubject = cal.calGetString("calendar-event-dialog", "emailSubjectReply", [item.title]);
         let identity = item.calendar.getProperty("imip.identity");
         sendMailTo(email, emailSubject, null, identity);
     }
 }
@@ -260,22 +260,22 @@ function taskViewOnLoad() {
                                                    "keyLabelMac" : "keyLabelNonMac");
 
             textFilter.setAttribute("placeholder", base.replace("#1", keyLabel));
             textFilter.value = "";
         }
     }
 
     // Setup customizeDone handler for the task action toolbox.
-    var toolbox = document.getElementById("task-actions-toolbox");
+    let toolbox = document.getElementById("task-actions-toolbox");
     toolbox.customizeDone = function(aEvent) {
         MailToolboxCustomizeDone(aEvent, "CustomizeTaskActionsToolbar");
     };
 
-    var toolbarset = document.getElementById("customToolbars");
+    let toolbarset = document.getElementById("customToolbars");
     toolbox.toolbarset = toolbarset;
 
     Services.obs.notifyObservers(window, "calendar-taskview-startup-done", false);
 }
 
 /**
  * Copy the value of the given link node to the clipboard
  *
--- a/calendar/base/content/calendar-ui-utils.js
+++ b/calendar/base/content/calendar-ui-utils.js
@@ -148,45 +148,45 @@ function disableElement(aElement) {
  */
 function disableElementWithLock(elementId, lockId) {
     // unconditionally disable the element.
     disableElement(elementId);
 
     // remember that this element has been locked with
     // the key passed as argument. we keep a primitive
     // form of ref-count in the attribute 'lock'.
-    var element = document.getElementById(elementId);
+    let element = document.getElementById(elementId);
     if (element) {
         if (!element.hasAttribute(lockId)) {
             element.setAttribute(lockId, "true");
-            var n = parseInt(element.getAttribute("lock") || 0, 10);
+            let n = parseInt(element.getAttribute("lock") || 0, 10);
             element.setAttribute("lock", n + 1);
         }
     }
 }
 
 /**
  * This function is intended to be used in tandem with the
  * above defined function 'disableElementWithLock()'.
  * See the respective comment for further details.
  *
  * @see disableElementWithLock
  * @param elementId     The element ID of the element to enable.
  * @param lockId        The ID of the lock to set.
  */
 function enableElementWithLock(elementId, lockId) {
-    var element = document.getElementById(elementId);
+    let element = document.getElementById(elementId);
     if (!element) {
         dump("unable to find " + elementId + "\n");
         return;
     }
 
     if (element.hasAttribute(lockId)) {
         element.removeAttribute(lockId);
-        var n = parseInt(element.getAttribute("lock") || 0, 10) - 1;
+        let n = parseInt(element.getAttribute("lock") || 0, 10) - 1;
         if (n > 0) {
             element.setAttribute("lock", n);
         } else {
             element.removeAttribute("lock");
         }
         if (n <= 0) {
             enableElement(elementId);
         }
@@ -195,20 +195,20 @@ function enableElementWithLock(elementId
 
 /**
  * Unchecks the commands of the child elements of a DOM-tree-node i.e of a menu
  *
  * @param aEvent    The event from which the target is taken to retrieve the
  *                    child elements
  */
 function uncheckChildNodes(aEvent) {
-    var liveList = aEvent.target.getElementsByAttribute("checked", "true");
-    for (var i = liveList.length - 1; i >= 0; i--) {
-        var commandName = liveList.item(i).getAttribute("command");
-        var command = document.getElementById(commandName);
+    let liveList = aEvent.target.getElementsByAttribute("checked", "true");
+    for (let i = liveList.length - 1; i >= 0; i--) {
+        let commandName = liveList.item(i).getAttribute("command");
+        let command = document.getElementById(commandName);
         if (command) {
             command.setAttribute("checked", "false");
         }
     }
 }
 
 /**
  * Removes all child nodes of the given node
@@ -340,22 +340,22 @@ function addMenuItem(aParent, aLabel, aV
  * @param aFilterAttribute  (optional) The name of an attribute that the child nodes carry
  *                            and that is used to filter the childnodes.
  * @param aFilterValue      (optional) The value of the filterattribute. If set only those
  *                            childnodes are modified that have an attribute
  *                            'aFilterAttribute' with the given value
  *                            'aFilterValue' set.
  */
 function setAttributeToChildren(aParent, aAttribute, aValue, aFilterAttribute, aFilterValue) {
-    for (var i = 0; i < aParent.childNodes.length; i++) {
-        var element = aParent.childNodes[i];
+    for (let i = 0; i < aParent.childNodes.length; i++) {
+        let element = aParent.childNodes[i];
         if (aFilterAttribute == null) {
             setElementValue(element, aValue, aAttribute);
         } else if (element.hasAttribute(aFilterAttribute)) {
-            var compValue = element.getAttribute(aFilterAttribute);
+            let compValue = element.getAttribute(aFilterAttribute);
             if (compValue === aFilterValue) {
                 setElementValue(element, aValue, aAttribute);
             }
         }
     }
 }
 
 /**
@@ -363,20 +363,20 @@ function setAttributeToChildren(aParent,
  *
  * @param aParent  The parent node of the 'radio controls', either radios
  *                  or menuitems of the type 'radio'.
  * @param avalue   The value of the radio control bound to be checked.
  * @return         True or false depending on if the a 'radio control' with the
  *                  given value could be checked.
  */
 function checkRadioControl(aParent, aValue) {
-    for (var i = 0; i < aParent.childNodes.length; i++) {
-        var element = aParent.childNodes[i];
+    for (let i = 0; i < aParent.childNodes.length; i++) {
+        let element = aParent.childNodes[i];
         if (element.hasAttribute("value")) {
-            var compValue = element.getAttribute("value");
+            let compValue = element.getAttribute("value");
             if (compValue == aValue) {
                 if (element.localName == "menuitem") {
                     if (element.getAttribute("type") == "radio") {
                         element.setAttribute("checked", "true");
                         return true;
                     }
                 } else if (element.localName == "radio") {
                     element.radioGroup.selectedItem = element;
@@ -390,30 +390,30 @@ function checkRadioControl(aParent, aVal
 
 /**
  * Enables or disables the given element depending on the checkbox state.
  *
  * @param checkboxId    The ID of the XUL checkbox element.
  * @param elementId     The element to change the disabled state on.
  */
 function processEnableCheckbox(checkboxId, elementId) {
-    var checked = document.getElementById(checkboxId).checked;
+    let checked = document.getElementById(checkboxId).checked;
     setElementValue(elementId, !checked && "true", "disabled");
 }
 
 /**
  * Enable/disable button if there are children in a listbox
  *
  * XXX This function needs renaming, it can do more than just buttons.
  *
  * @param listboxId     The ID of the listbox to check.
  * @param buttonId      The element to change the disabled state on.
  */
 function updateListboxDeleteButton(listboxId, buttonId) {
-    var rowCount = document.getElementById(listboxId).getRowCount();
+    let rowCount = document.getElementById(listboxId).getRowCount();
     setElementValue(buttonId, rowCount < 1 && "true", "disabled");
 }
 
 /**
  * Gets the correct plural form of a given unit.
  *
  * @param aLength         The number to use to determine the plural form
  * @param aUnit           The unit to find the plural form of
@@ -472,37 +472,37 @@ function updateMenuLabelsPlural(aLengthF
  *
  * XXX Isn't it enough to just do menuList.value = value ?
  *
  * @param menuListId    The ID of the menulist to check.
  * @param value         The value to set.
  * @throws              String error if value not found.
  */
 function menuListSelectItem(menuListId, value) {
-    var menuList = document.getElementById(menuListId);
-    var index = menuListIndexOf(menuList, value);
+    let menuList = document.getElementById(menuListId);
+    let index = menuListIndexOf(menuList, value);
     if (index != -1) {
         menuList.selectedIndex = index;
     } else {
         throw "menuListSelectItem: No such Element: " + value;
     }
 }
 
 /**
  * Find index of menuitem with the given value, or return -1 if not found.
  *
  * @param menuListId    The XUL menulist node to check.
  * @param value         The value to look for.
  * @return              The child index of the node that matches, or -1.
  */
 function menuListIndexOf(menuList, value) {
-    var items = menuList.menupopup.childNodes;
-    var index = -1;
-    for (var i = 0; i < items.length; i++) {
-        var element = items[i];
+    let items = menuList.menupopup.childNodes;
+    let index = -1;
+    for (let i = 0; i < items.length; i++) {
+        let element = items[i];
         if (element.nodeName == "menuitem") {
             index++;
         }
         if (element.getAttribute("value") == value) {
             return index;
         }
     }
     return -1; // not found
@@ -524,19 +524,19 @@ function createXULElement(el) {
  * see also
  * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSview-getComputedStyle
  * @param aXULElement   The xul element to be inspected.
  * @param aStyleProps   The css style properties for which values are to be retrieved
  *                        e.g. 'font-size', 'min-width" etc.
  * @return              An integer value denoting the optimal minimum width
  */
 function getSummarizedStyleValues(aXULElement, aStyleProps) {
-    var retValue = 0;
-    var cssStyleDeclares = document.defaultView.getComputedStyle(aXULElement, null);
-    for (var prop of aStyleProps) {
+    let retValue = 0;
+    let cssStyleDeclares = document.defaultView.getComputedStyle(aXULElement, null);
+    for (let prop of aStyleProps) {
         retValue += parseInt(cssStyleDeclares.getPropertyValue(prop), 10);
     }
     return retValue;
 }
 
 /**
  * Calculates the optimal minimum width based on the set css style-rules
  * by considering the css rules for the min-width, padding, border, margin
@@ -559,18 +559,18 @@ function getOptimalMinimumWidth(aXULElem
  * by assuming that it's size is about one third of the size of the font-size
  *
  * @param aXULElement   The xul-element to be inspected.
  * @return              An integer value denoting the optimal minimum height
  */
 function getOptimalMinimumHeight(aXULElement) {
     // the following line of code presumes that the line-height is set to "normal"
     // which is supposed to be a "reasonable distance" between the lines
-    var firstEntity = parseInt(1.35 * getSummarizedStyleValues(aXULElement, ["font-size"]), 10);
-    var secondEntity = getSummarizedStyleValues(aXULElement,
+    let firstEntity = parseInt(1.35 * getSummarizedStyleValues(aXULElement, ["font-size"]), 10);
+    let secondEntity = getSummarizedStyleValues(aXULElement,
                                                 ["padding-bottom", "padding-top",
                                                 "margin-bottom", "margin-top",
                                                 "border-bottom-width", "border-top-width"]);
     return (firstEntity + secondEntity);
 }
 
 /**
  * Gets the "other" orientation value, i.e if "horizontal" is passed, "vertical"
@@ -588,17 +588,17 @@ function getOtherOrientation(aOrientatio
  * menuitem is selected. This function takes care by reselecting the item
  *
  * @param aElement  The element to update, or its id as a string
  */
 function updateSelectedLabel(aElement) {
     if (typeof aElement == "string") {
         aElement = document.getElementById(aElement);
     }
-    var selectedIndex = aElement.selectedIndex;
+    let selectedIndex = aElement.selectedIndex;
     aElement.selectedIndex = -1;
     aElement.selectedIndex = selectedIndex;
 }
 
 /**
  * Sets up the attendance context menu, based on the given items
  *
  * @param aMenu     The DOM Node of the menupopup to set up
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -873,26 +873,26 @@ function addItemsFromSingleCalendarInter
 }
 
 function addItemsFromCalendar(aCalendar, aAddItemsInternalFunc) {
     if (isUnifinderHidden()) {
         // If the unifinder is hidden, don't refresh the events to reduce needed
         // getItems calls.
         return;
     }
-    var refreshListener = {
+    let refreshListener = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
         mEventArray: [],
 
         onOperationComplete: function rET_onOperationComplete(aOpCalendar,
                                                               aStatus,
                                                               aOperationType,
                                                               aId,
                                                               aDateTime) {
-            var refreshTreeInternalFunc = function() {
+            let refreshTreeInternalFunc = function() {
                 aAddItemsInternalFunc(refreshListener.mEventArray);
             };
             setTimeout(refreshTreeInternalFunc, 0);
         },
 
         onGetResult: function rET_onGetResult(aOpCalendar,
                                               aStatus,
                                               aItemType,
--- a/calendar/base/content/calendar-view-core.xml
+++ b/calendar/base/content/calendar-view-core.xml
@@ -145,31 +145,31 @@
 
       <property name="eventNameLabel" readonly="true"
         onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'event-name');"/>
       <property name="eventNameTextbox" readonly="true"
         onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'event-name-textbox');"/>
 
       <method name="setEditableLabel">
         <body><![CDATA[
-          var evl = this.eventNameLabel;
-          var item = this.mOccurrence;
+          let evl = this.eventNameLabel;
+          let 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;
+          let item = this.mOccurrence;
           this.setAttribute("calendar-uri", item.calendar.uri.spec);
           this.setAttribute("calendar-id", item.calendar.id);
-          var categoriesArray = item.getCategories({});
+          let categoriesArray = item.getCategories({});
           if (categoriesArray.length > 0) {
-            var cssClassesArray = categoriesArray.map(formatStringForCSSRule);
+            let cssClassesArray = categoriesArray.map(formatStringForCSSRule);
             this.setAttribute("categories", cssClassesArray.join(" "));
           }
 
           // Add alarm icons as needed.
           let alarms = item.getAlarms({});
           if (alarms.length && Preferences.get("calendar.alarms.indicator.show", true)) {
               let iconsBox = document.getAnonymousElementByAttribute(this, "anonid", "alarm-icons-box");
               cal.alarms.addReminderImages(iconsBox, alarms);
@@ -322,17 +322,17 @@
 
         // If the left button was used and the item is already selected
         // and there are no multiple items selected start
         // the 'single click edit' timeout. Otherwise select the item too.
         // Also, check if the calendar is readOnly or we are offline.
 
         if (this.selected && !(event.ctrlKey || event.metaKey) &&
               isCalendarWritable(this.mOccurrence.calendar)) {
-            var self = this;
+            let self = this;
             if (this.editingTimer) {
                 clearTimeout(this.editingTimer);
             }
             this.editingTimer = setTimeout(function editingTimeout() { self.startEditing(); }, 350);
         } else {
             this.select(event);
             event.stopPropagation();
         }
@@ -343,17 +343,17 @@
 
         // stop 'single click edit' timeout (if started)
         if (this.editingTimer) {
             clearTimeout(this.editingTimer);
             this.editingTimer = null;
         }
 
         if (this.calendarView && this.calendarView.controller) {
-            var item = (event.ctrlKey) ? this.mOccurrence.parentItem : this.mOccurrence;
+            let item = (event.ctrlKey) ? this.mOccurrence.parentItem : this.mOccurrence;
             this.calendarView.controller.modifyOccurrence(item);
         }
       ]]></handler>
       <handler event="mouseover"><![CDATA[
         if (this.calendarView && this.calendarView.controller) {
             event.stopPropagation();
             onMouseOverItem(event);
         }
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -87,38 +87,38 @@ var calendarViewController = {
      * Deletes the given occurrences
      * @see calICalendarViewController
      */
     deleteOccurrences: function(aCount,
                                 aOccurrences,
                                 aUseParentItems,
                                 aDoNotConfirm) {
         startBatchTransaction();
-        var recurringItems = {};
+        let recurringItems = {};
 
-        function getSavedItem(aItemToDelete) {
+        let getSavedItem = function(aItemToDelete) {
             // Get the parent item, saving it in our recurringItems object for
             // later use.
-            var hashVal = aItemToDelete.parentItem.hashId;
+            let hashVal = aItemToDelete.parentItem.hashId;
             if (!recurringItems[hashVal]) {
                 recurringItems[hashVal] = {
                     oldItem: aItemToDelete.parentItem,
                     newItem: aItemToDelete.parentItem.clone()
                 };
             }
             return recurringItems[hashVal];
-        }
+        };
 
         // 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); });
+        let occurrences = aOccurrences.filter(function(item) { return isCalendarWritable(item.calendar); });
 
         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) {
@@ -134,29 +134,29 @@ var calendarViewController = {
                 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);
+                let savedItem = getSavedItem(itemToDelete);
                 savedItem.newItem.recurrenceInfo
                          .removeOccurrenceAt(itemToDelete.recurrenceId);
                 // Dont start the transaction yet. Do so later, in case the
                 // parent item gets modified more than once.
             } else {
                 doTransaction('delete', itemToDelete, itemToDelete.calendar, null, null);
             }
         }
 
         // Now handle recurring events. This makes sure that all occurrences
         // that have been passed are deleted.
-        for (var hashVal in recurringItems) {
+        for (let hashVal in recurringItems) {
             let ritem = recurringItems[hashVal];
             doTransaction('modify',
                           ritem.newItem,
                           ritem.newItem.calendar,
                           ritem.oldItem,
                           null);
         }
         endBatchTransaction();
@@ -165,26 +165,26 @@ var calendarViewController = {
 
 /**
  * This function does the common steps to switch between views. Should be called
  * from app-specific view switching functions
  *
  * @param aViewType     The type of view to select.
  */
 function switchToView(aViewType) {
-    var viewDeck = getViewDeck();
-    var selectedDay;
-    var currentSelection = [];
+    let viewDeck = getViewDeck();
+    let selectedDay;
+    let currentSelection = [];
 
     // Set up the view commands
-    var views = viewDeck.childNodes;
-    for (var i = 0; i < views.length; i++) {
+    let views = viewDeck.childNodes;
+    for (let i = 0; i < views.length; i++) {
         let view = views[i];
-        var commandId = "calendar_" + view.id + "_command";
-        var command = document.getElementById(commandId);
+        let commandId = "calendar_" + view.id + "_command";
+        let command = document.getElementById(commandId);
         if (view.id == aViewType + "-view") {
             command.setAttribute("checked", "true");
         } else {
             command.removeAttribute("checked");
         }
     }
 
     /**
@@ -289,32 +289,32 @@ var gMidnightTimer;
  *
  * XXX This function is not very usable, since there is only one midnight timer.
  * Better would be a function that uses the observer service to notify at
  * midnight.
  *
  * @param aRefreshCallback      A callback to be called at midnight.
  */
 function scheduleMidnightUpdate(aRefreshCallback) {
-    var jsNow = new Date();
-    var tomorrow = new Date(jsNow.getFullYear(), jsNow.getMonth(), jsNow.getDate() + 1);
-    var msUntilTomorrow = tomorrow.getTime() - jsNow.getTime();
+    let jsNow = new Date();
+    let tomorrow = new Date(jsNow.getFullYear(), jsNow.getMonth(), jsNow.getDate() + 1);
+    let msUntilTomorrow = tomorrow.getTime() - jsNow.getTime();
 
     // Is an nsITimer/callback extreme overkill here? Yes, but it's necessary to
     // workaround bug 291386.  If we don't, we stand a decent chance of getting
     // stuck in an infinite loop.
-    var udCallback = {
+    let udCallback = {
         notify: function(timer) {
             aRefreshCallback();
         }
     };
 
     if (!gMidnightTimer) {
         // Observer for wake after sleep/hibernate/standby to create new timers and refresh UI
-        var wakeObserver = {
+        let wakeObserver = {
            observe: function(aSubject, aTopic, aData) {
                if (aTopic == "wake_notification") {
                    // postpone refresh for another couple of seconds to get netwerk ready:
                    if (this.mTimer) {
                        this.mTimer.cancel();
                    } else {
                        this.mTimer = Components.classes["@mozilla.org/timer;1"]
                                                .createInstance(Components.interfaces.nsITimer);
@@ -458,32 +458,32 @@ var categoryManagement = {
 /**
  * Handler function to set the selected day in the minimonth to the currently
  * selected day in the current view.
  *
  * @param event     The "dayselect" event emitted from the views.
  *
  */
 function observeViewDaySelect(event) {
-    var date = event.detail;
-    var jsDate = new Date(date.year, date.month, date.day);
+    let date = event.detail;
+    let jsDate = new Date(date.year, date.month, date.day);
 
     // for the month and multiweek view find the main month,
     // which is the month with the most visible days in the view;
     // note, that the main date is the first day of the main month
-    var jsMainDate;
+    let jsMainDate;
     if (!event.originalTarget.supportsDisjointDates) {
-        var mainDate = null;
-        var maxVisibleDays = 0;
-        var startDay = currentView().startDay;
-        var endDay = currentView().endDay;
-        var firstMonth = startDay.startOfMonth;
-        var lastMonth = endDay.startOfMonth;
-        for (var month = firstMonth.clone(); month.compare(lastMonth) <= 0; month.month += 1) {
-            var visibleDays = 0;
+        let mainDate = null;
+        let maxVisibleDays = 0;
+        let startDay = currentView().startDay;
+        let endDay = currentView().endDay;
+        let firstMonth = startDay.startOfMonth;
+        let lastMonth = endDay.startOfMonth;
+        for (let month = firstMonth.clone(); month.compare(lastMonth) <= 0; month.month += 1) {
+            let visibleDays = 0;
             if (month.compare(firstMonth) == 0) {
                 visibleDays = startDay.endOfMonth.day - startDay.day + 1;
             } else if (month.compare(lastMonth) == 0) {
                 visibleDays = endDay.day;
             } else {
                 visibleDays = month.endOfMonth.day;
             }
             if (visibleDays > maxVisibleDays) {
@@ -507,75 +507,75 @@ function observeViewDaySelect(event) {
 function getMinimonth() {
     return document.getElementById("calMinimonth");
 }
 
 /**
  * Update the view orientation based on the checked state of the command
  */
 function toggleOrientation() {
-    var cmd = document.getElementById("calendar_toggle_orientation_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
+    let cmd = document.getElementById("calendar_toggle_orientation_command");
+    let newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
     cmd.setAttribute("checked", newValue);
 
-    var deck = getViewDeck();
-    for (var view of deck.childNodes) {
+    let deck = getViewDeck();
+    for (let view of deck.childNodes) {
         view.rotated = (newValue == "true");
     }
 
     // orientation refreshes automatically
 }
 
 /**
  * Toggle the workdays only checkbox and refresh the current view
  *
  * XXX We shouldn't need to refresh the view just to toggle the workdays. This
  * should happen automatically.
  */
 function toggleWorkdaysOnly() {
-    var cmd = document.getElementById("calendar_toggle_workdays_only_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
+    let cmd = document.getElementById("calendar_toggle_workdays_only_command");
+    let newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
     cmd.setAttribute("checked", newValue);
 
-    var deck = getViewDeck();
-    for (var view of deck.childNodes) {
+    let deck = getViewDeck();
+    for (let view of deck.childNodes) {
         view.workdaysOnly = (newValue == "true");
     }
 
     // Refresh the current view
     currentView().goToDay();
 }
 
 /**
  * Toggle the tasks in view checkbox and refresh the current view
  */
 function toggleTasksInView() {
-    var cmd = document.getElementById("calendar_toggle_tasks_in_view_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
+    let cmd = document.getElementById("calendar_toggle_tasks_in_view_command");
+    let newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
     cmd.setAttribute("checked", newValue);
 
-    var deck = getViewDeck();
-    for (var view of deck.childNodes) {
+    let deck = getViewDeck();
+    for (let view of deck.childNodes) {
         view.tasksInView = (newValue == "true");
     }
 
     // Refresh the current view
     currentView().goToDay();
 }
 
 /**
  * Toggle the show completed in view checkbox and refresh the current view
  */
 function toggleShowCompletedInView() {
-    var cmd = document.getElementById("calendar_toggle_show_completed_in_view_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
+    let cmd = document.getElementById("calendar_toggle_show_completed_in_view_command");
+    let newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
     cmd.setAttribute("checked", newValue);
 
-    var deck = getViewDeck();
-    for (var view of deck.childNodes) {
+    let deck = getViewDeck();
+    for (let view of deck.childNodes) {
         view.showCompleted = (newValue == "true");
     }
 
     // Refresh the current view
     currentView().goToDay();
 }
 
 /**
@@ -590,85 +590,85 @@ function goToDate(aDate) {
 
 /**
  * Returns the calendar view that was selected before restart, or the current
  * calendar view if it has already been set in this session
  *
  * @return          The last calendar view.
  */
 function getLastCalendarView() {
-    var deck = getViewDeck();
+    let deck = getViewDeck();
     if (deck.selectedIndex > -1) {
-        var viewNode = deck.childNodes[deck.selectedIndex];
+        let viewNode = deck.childNodes[deck.selectedIndex];
         return viewNode.id.replace(/-view/, "");
     }
 
     // No deck item was selected beforehand, default to week view.
     return "week";
 }
 
 /**
  * Deletes items currently selected in the view and clears selection.
  */
 function deleteSelectedEvents() {
-    var selectedItems = currentView().getSelectedItems({});
+    let selectedItems = currentView().getSelectedItems({});
     calendarViewController.deleteOccurrences(selectedItems.length,
                                              selectedItems,
                                              false,
                                              false);
     // clear selection
     currentView().setSelectedItems(0, [], true);
 }
 
 /**
  * Edit the items currently selected in the view with the event dialog.
  */
 function editSelectedEvents() {
-    var selectedItems = currentView().getSelectedItems({});
+    let selectedItems = currentView().getSelectedItems({});
     if (selectedItems && selectedItems.length >= 1) {
         modifyEventWithDialog(selectedItems[0], null, true);
     }
 }
 
 /**
  * Select all events from all calendars. Use with care.
  */
 function selectAllEvents() {
-    var items = [];
-    var listener = {
+    let items = [];
+    let listener = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
         onOperationComplete: function selectAll_ooc(aCalendar, aStatus,
                                                     aOperationType, aId,
                                                     aDetail) {
             currentView().setSelectedItems(items.length, items, false);
         },
         onGetResult: function selectAll_ogr(aCalendar, aStatus, aItemType,
                                             aDetail, aCount, aItems) {
-            for (var item of aItems) {
+            for (let item of aItems) {
                 items.push(item);
             }
         }
     };
 
-    var composite = getCompositeCalendar();
-    var filter = composite.ITEM_FILTER_CLASS_OCCURRENCES;
+    let composite = getCompositeCalendar();
+    let filter = composite.ITEM_FILTER_CLASS_OCCURRENCES;
 
     if (currentView().tasksInView) {
         filter |= composite.ITEM_FILTER_TYPE_ALL;
     } else {
         filter |= composite.ITEM_FILTER_TYPE_EVENT;
     }
     if (currentView().showCompleted) {
         filter |= composite.ITEM_FILTER_COMPLETED_ALL;
     } else {
         filter |= composite.ITEM_FILTER_COMPLETED_NO;
     }
 
     // Need to move one day out to get all events
-    var end = currentView().endDay.clone();
+    let end = currentView().endDay.clone();
     end.day += 1;
 
     composite.getItems(filter, 0, currentView().startDay, end, listener);
 }
 
 var cal = cal || {};
 cal.navigationBar = {
     setDateRange: function setDateRange(aStartDate, aEndDate) {
--- a/calendar/base/content/calendar-views.xml
+++ b/calendar/base/content/calendar-views.xml
@@ -37,17 +37,17 @@
                 ]]></body>
             </method>
             <method name="moveView">
                 <parameter name="aNumber"/>
                 <body><![CDATA[
                     if (!aNumber) {
                         this.goToDay(now());
                     } else {
-                        var currentDay = this.startDay.clone();
+                        let currentDay = this.startDay.clone();
                         currentDay.day += aNumber;
                         this.goToDay(currentDay);
                     }
                 ]]></body>
             </method>
         </implementation>
     </binding>
 
@@ -90,30 +90,30 @@
                 <body><![CDATA[
                     this.displayDaysOff = !this.mWorkdaysOnly;
 
                     if (!aDate) {
                         this.refresh();
                         return;
                     }
                     aDate = aDate.getInTimezone(this.timezone);
-                    var d1 = getWeekInfoService().getStartOfWeek(aDate);
-                    var d2 = d1.clone();
+                    let d1 = getWeekInfoService().getStartOfWeek(aDate);
+                    let d2 = d1.clone();
                     d2.day += 6;
                     this.setDateRange(d1, d2);
                     this.selectedDay = aDate;
                 ]]></body>
             </method>
             <method name="moveView">
                 <parameter name="aNumber"/>
                 <body><![CDATA[
                     if (!aNumber) {
                         this.goToDay(now());
                     } else {
-                        var d1 = this.selectedDay.clone();
+                        let d1 = this.selectedDay.clone();
                         d1.day += 7 * aNumber;
                         this.goToDay(d1);
                     }
                 ]]></body>
             </method>
         </implementation>
     </binding>
 
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -29,17 +29,17 @@ function intializeTabOrWindowVariables()
     }
 }
 
 /**
  * Dispose of controlling operations of this event dialog. Uses
  * window.arguments[0].job.dispose()
  */
 function dispose() {
-    var args = window.arguments[0];
+    let args = window.arguments[0];
     if (args.job && args.job.dispose) {
         args.job.dispose();
     }
     resetDialogId(document.documentElement);
 }
 
 /**
  * Sets the id of a Dialog to another value to allow different window-icons to be displayed.
@@ -168,17 +168,17 @@ function updateReminderDetails() {
     let reminderList = document.getElementById("item-alarm");
     let reminderMultipleLabel = document.getElementById("reminder-multiple-alarms-label");
     let iconBox = document.getElementById("reminder-icon-box");
     let reminderSingleLabel = document.getElementById("reminder-single-alarms-label");
     let reminders = document.getElementById("reminder-custom-menuitem").reminders || [];
     let calendar = getCurrentCalendar();
     let actionValues = calendar.getProperty("capabilities.alarms.actionValues") || ["DISPLAY"];
     let actionMap = {};
-    for (var action of actionValues) {
+    for (let action of actionValues) {
         actionMap[action] = true;
     }
 
     // Filter out any unsupported action types.
     reminders = reminders.filter(x => x.action in actionMap);
 
     if (reminderList.value == "custom") {
         // Depending on how many alarms we have, show either the "Multiple Alarms"
@@ -497,42 +497,43 @@ function commonUpdateReminder(aSuppressD
     updateReminderDetails();
 }
 
 /**
  * Updates the related link on the dialog. Currently only used by the
  * read-only summary dialog.
  */
 function updateLink() {
-    var itemUrlString = window.calendarItem.getProperty("URL") || "";
-    var linkCommand = document.getElementById("cmd_toggle_link");
-
     function hideOrShow(aBool) {
         setElementValue("event-grid-link-row", !aBool && "true", "hidden");
-        var separator = document.getElementById("event-grid-link-separator");
+        let separator = document.getElementById("event-grid-link-separator");
         if (separator) {
             // The separator is not there in the summary dialog
             setElementValue("event-grid-link-separator", !aBool && "true", "hidden");
         }
     }
 
+    let itemUrlString = window.calendarItem.getProperty("URL") || "";
+    let linkCommand = document.getElementById("cmd_toggle_link");
+
+
     if (linkCommand) {
         // Disable if there is no url
         setElementValue(linkCommand,
                         !itemUrlString.length && "true",
                         "disabled");
     }
 
     if ((linkCommand && linkCommand.getAttribute("checked") != "true") ||
         !itemUrlString.length) {
         // Hide if there is no url, or the menuitem was chosen so that the url
         // should be hidden
         hideOrShow(false);
     } else {
-        var handler, uri;
+        let handler, uri;
         try {
             uri = makeURL(itemUrlString);
             handler = Services.io.getProtocolHandler(uri.scheme);
         } catch (e) {
             // No protocol handler for the given protocol, or invalid uri
             hideOrShow(false);
             return;
         }
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
@@ -33,20 +33,20 @@ function onLoad() {
     window.addEventListener("timebar", onTimebar, true);
     window.addEventListener("timechange", onTimeChange, true);
 
     // As long as DOMMouseScroll is still implemented, we need to keep it
     // around to make sure scrolling is blocked.
     window.addEventListener("wheel", onMouseScroll, true);
     window.addEventListener("DOMMouseScroll", onMouseScroll, true);
 
-    var args = window.arguments[0];
-    var startTime = args.startTime;
-    var endTime = args.endTime;
-    var calendar = args.calendar;
+    let args = window.arguments[0];
+    let startTime = args.startTime;
+    let endTime = args.endTime;
+    let calendar = args.calendar;
 
     gDisplayTimezone = args.displayTimezone;
 
     onChangeCalendar(calendar);
 
 
     let zoom = document.getElementById("zoom-menulist");
     let zoomOut = document.getElementById("zoom-out-button");
@@ -82,35 +82,35 @@ function onLoad() {
     propagateDateTime();
     // Set the scroll bar at where the event is
     scrollToCurrentTime();
     updateButtons();
 
     // we need to enforce several layout constraints which can't be modelled
     // with plain xul and css, at least as far as i know.
     const kStylesheet = "chrome://calendar/skin/calendar-event-dialog.css";
-    for (var stylesheet of document.styleSheets) {
+    for (let stylesheet of document.styleSheets) {
         if (stylesheet.href == kStylesheet) {
             // make the dummy-spacer #1 [top] the same height as the timebar
-            var timebar = document.getElementById("timebar");
+            let timebar = document.getElementById("timebar");
             stylesheet.insertRule(
                 ".attendee-spacer-top { height: "
                     + timebar.boxObject.height + "px; }", 0);
             // make the dummy-spacer #2 [bottom] the same height as the scrollbar
-            var scrollbar = document.getElementById("horizontal-scrollbar");
+            let scrollbar = document.getElementById("horizontal-scrollbar");
             stylesheet.insertRule(
                 ".attendee-spacer-bottom { height: "
                     + scrollbar.boxObject.height + "px; }", 0);
             break;
         }
     }
 
     // attach an observer to get notified of changes
     // that are relevant to this dialog.
-    var prefObserver = {
+    let prefObserver = {
         observe: function aD_observe(aSubject, aTopic, aPrefName) {
             switch (aPrefName) {
                 case "calendar.view.daystarthour":
                 case "calendar.view.dayendhour":
                     initTimeRange();
                     propagateDateTime();
                     break;
             }
@@ -129,17 +129,17 @@ function onLoad() {
 
 /**
  * This function should be called when the accept button was pressed on the
  * attendee dialog. Calls the accept function specified in the window arguments.
  *
  * @return      Returns true, if the dialog should be closed.
  */
 function onAccept() {
-    var attendees = document.getElementById("attendees-list");
+    let attendees = document.getElementById("attendees-list");
     window.arguments[0].onOk(
         attendees.attendees,
         attendees.organizer,
         gStartDate.getInTimezone(gStartTimezone),
         gEndDate.getInTimezone(gEndTimezone));
     return true;
 }
 
@@ -172,61 +172,61 @@ function zoomWithButtons(aZoomOut) {
  * Loads the passed start and end dates, fills global variables that give
  * information about the state of the dialog.
  *
  * @param aStartDate        The date/time the grid should start at.
  * @param aEndDate          The date/time the grid should end at.
  */
 function loadDateTime(aStartDate, aEndDate) {
     gDuration = aEndDate.subtractDate(aStartDate);
-    var kDefaultTimezone = calendarDefaultTimezone();
+    let kDefaultTimezone = calendarDefaultTimezone();
     gStartTimezone = aStartDate.timezone;
     gEndTimezone = aEndDate.timezone;
     gStartDate = aStartDate.getInTimezone(kDefaultTimezone);
     gEndDate = aEndDate.getInTimezone(kDefaultTimezone);
     gStartDate.makeImmutable();
     gEndDate.makeImmutable();
 }
 
 /**
  * Sets up the time grid using the global start and end dates.
  */
 function propagateDateTime() {
     // Fill the controls
     updateDateTime();
 
     // Tell the timebar about the new start/enddate
-    var timebar = document.getElementById("timebar");
+    let timebar = document.getElementById("timebar");
     timebar.startDate = gStartDate;
     timebar.endDate = gEndDate;
     timebar.refresh();
 
     // Tell the selection-bar about the new start/enddate
-    var selectionbar = document.getElementById("selection-bar");
+    let selectionbar = document.getElementById("selection-bar");
     selectionbar.startDate = gStartDate;
     selectionbar.endDate = gEndDate;
     selectionbar.update();
 
     // Tell the freebusy grid about the new start/enddate
-    var grid = document.getElementById("freebusy-grid");
+    let grid = document.getElementById("freebusy-grid");
 
-    var refresh = (grid.startDate == null) ||
+    let refresh = (grid.startDate == null) ||
                   (grid.startDate.compare(gStartDate) != 0) ||
                   (grid.endDate == null) ||
                   (grid.endDate.compare(gEndDate) != 0);
     grid.startDate = gStartDate;
     grid.endDate = gEndDate;
     if (refresh) {
         grid.forceRefresh();
     }
 
     // Expand to 24hrs if the new range is outside of the default range.
-    var kDefaultTimezone = calendarDefaultTimezone();
-    var startTime = gStartDate.getInTimezone(kDefaultTimezone);
-    var endTime = gEndDate.getInTimezone(kDefaultTimezone);
+    let kDefaultTimezone = calendarDefaultTimezone();
+    let startTime = gStartDate.getInTimezone(kDefaultTimezone);
+    let endTime = gEndDate.getInTimezone(kDefaultTimezone);
     if ((startTime.hour < gStartHour) ||
         (startTime.hour >= gEndHour) ||
         (endTime.hour >= gEndHour) ||
         (startTime.day != endTime.day) ||
         (startTime.isDate)) {
         setForce24Hours(true);
     }
 }
@@ -297,26 +297,26 @@ function updateDateTime() {
  * This function requires gStartDate and gEndDate and the respective timezone
  * variables to be initialized. It updates the timezone information displayed in
  * the dialog from the above noted variables.
  */
 function updateTimezone() {
     gIgnoreUpdate = true;
 
     if (gDisplayTimezone) {
-        var startTimezone = gStartTimezone;
-        var endTimezone = gEndTimezone;
-        var equalTimezones = false;
+        let startTimezone = gStartTimezone;
+        let endTimezone = gEndTimezone;
+        let equalTimezones = false;
         if (startTimezone && endTimezone &&
             (compareObjects(startTimezone, endTimezone) || endTimezone.isUTC)) {
             equalTimezones = true;
         }
 
-        var tzStart = document.getElementById("timezone-starttime");
-        var tzEnd = document.getElementById("timezone-endtime");
+        let tzStart = document.getElementById("timezone-starttime");
+        let tzEnd = document.getElementById("timezone-endtime");
         if (startTimezone != null) {
             tzStart.removeAttribute('collapsed');
             tzStart.value = startTimezone.displayName || startTimezone.tzid;
         } else {
             tzStart.setAttribute('collapsed', 'true');
         }
 
         // we never display the second timezone if both are equal
@@ -373,85 +373,85 @@ function updateStartTime() {
 /**
  * Updates gEndDate from the end time picker "event-endtime"
  */
 function updateEndTime() {
     if (gIgnoreUpdate) {
         return;
     }
 
-    var startWidgetId = "event-starttime";
-    var endWidgetId = "event-endtime";
+    let startWidgetId = "event-starttime";
+    let endWidgetId = "event-endtime";
 
-    var startWidget = document.getElementById(startWidgetId);
-    var endWidget = document.getElementById(endWidgetId);
+    let startWidget = document.getElementById(startWidgetId);
+    let endWidget = document.getElementById(endWidgetId);
 
-    var saveStartTime = gStartDate;
-    var saveEndTime = gEndDate;
-    var kDefaultTimezone = calendarDefaultTimezone();
+    let saveStartTime = gStartDate;
+    let saveEndTime = gEndDate;
+    let kDefaultTimezone = calendarDefaultTimezone();
 
     gStartDate = cal.jsDateToDateTime(startWidget.value,
                                   gDisplayTimezone ? gStartTimezone : calendarDefaultTimezone());
 
-    var timezone = gEndTimezone;
+    let timezone = gEndTimezone;
     if (timezone.isUTC &&
         gStartDate &&
         !compareObjects(gStartTimezone, gEndTimezone)) {
         timezone = gStartTimezone;
     }
     gEndDate = cal.jsDateToDateTime(endWidget.value,
                                     gDisplayTimezone ? timezone : kDefaultTimezone);
 
-    var allDayElement = document.getElementById("all-day");
-    var allDay = allDayElement.getAttribute("checked") == "true";
+    let allDayElement = document.getElementById("all-day");
+    let allDay = allDayElement.getAttribute("checked") == "true";
     if (allDay) {
         gStartDate.isDate = true;
         gEndDate.isDate = true;
     }
 
     // Calculate the new duration of start/end-time.
     // don't allow for negative durations.
-    var warning = false;
+    let warning = false;
     if (gEndDate.compare(gStartDate) >= 0) {
         gDuration = gEndDate.subtractDate(gStartDate);
     } else {
         gStartDate = saveStartTime;
         gEndDate = saveEndTime;
         warning = true;
     }
 
     propagateDateTime();
 
     if (warning) {
-        var callback = function() {
+        let callback = function() {
             Services.prompt.alert(
                 null,
                 document.title,
                 calGetString("calendar", "warningEndBeforeStart"));
         };
         setTimeout(callback, 1);
     }
 }
 
 /**
  * Prompts the user to pick a new timezone for the starttime. The dialog is
  * opened modally.
  */
 function editStartTimezone() {
-    var tzStart = document.getElementById("timezone-starttime");
+    let tzStart = document.getElementById("timezone-starttime");
     if (tzStart.hasAttribute("disabled")) {
         return;
     }
 
-    var self = this;
-    var args = {};
+    let self = this;
+    let args = {};
     args.calendar = window.arguments[0].calendar;
     args.time = gStartDate.getInTimezone(gStartTimezone);
     args.onOk = function(datetime) {
-        var equalTimezones = false;
+        let equalTimezones = false;
         if (gStartTimezone && gEndTimezone &&
             compareObjects(gStartTimezone, gEndTimezone)) {
             equalTimezones = true;
         }
         gStartTimezone = datetime.timezone;
         if (equalTimezones) {
             gEndTimezone = datetime.timezone;
         }
@@ -466,23 +466,23 @@ function editStartTimezone() {
         args);
 }
 
 /**
  * Prompts the user to pick a new timezone for the endtime. The dialog is
  * opened modally.
  */
 function editEndTimezone() {
-    var tzStart = document.getElementById("timezone-endtime");
+    let tzStart = document.getElementById("timezone-endtime");
     if (tzStart.hasAttribute("disabled")) {
         return;
     }
 
-    var self = this;
-    var args = {};
+    let self = this;
+    let args = {};
     args.calendar = window.arguments[0].calendar;
     args.time = gEndTime.getInTimezone(gEndTimezone);
     args.onOk = function(datetime) {
         if (gStartTimezone && gEndTimezone &&
             compareObjects(gStartTimezone, gEndTimezone)) {
             gStartTimezone = datetime.timezone;
         }
         gEndTimezone = datetime.timezone;
@@ -503,23 +503,23 @@ function editEndTimezone() {
  *
  * This for example disables the timepicker since its not needed.
  */
 function updateAllDay() {
     if (gIgnoreUpdate) {
         return;
     }
 
-    var allDayElement = document.getElementById("all-day");
-    var allDay = (allDayElement.getAttribute("checked") == "true");
-    var startpicker = document.getElementById("event-starttime");
-    var endpicker = document.getElementById("event-endtime");
+    let allDayElement = document.getElementById("all-day");
+    let allDay = (allDayElement.getAttribute("checked") == "true");
+    let startpicker = document.getElementById("event-starttime");
+    let endpicker = document.getElementById("event-endtime");
 
-    var tzStart = document.getElementById("timezone-starttime");
-    var tzEnd = document.getElementById("timezone-endtime");
+    let tzStart = document.getElementById("timezone-starttime");
+    let tzEnd = document.getElementById("timezone-endtime");
 
     // Disable the timezone links if 'allday' is checked OR the
     // calendar of this item is read-only. In any other case we
     // enable the links.
     if (allDay) {
         startpicker.setAttribute("timepickerdisabled", "true");
         endpicker.setAttribute("timepickerdisabled", "true");
 
@@ -539,31 +539,31 @@ function updateAllDay() {
 }
 
 /**
  * Changes the global variables to adapt for the change of the allday checkbox.
  *
  * XXX Function names are all very similar here. This needs some consistency!
  */
 function changeAllDay() {
-    var allDayElement = document.getElementById("all-day");
-    var allDay = (allDayElement.getAttribute("checked") == "true");
+    let allDayElement = document.getElementById("all-day");
+    let allDay = (allDayElement.getAttribute("checked") == "true");
 
     gStartDate = gStartDate.clone();
     gEndDate = gEndDate.clone();
 
     gStartDate.isDate = allDay;
     gEndDate.isDate = allDay;
 
     propagateDateTime();
 
     // After propagating the modified times we enforce some constraints
     // on the zoom-factor. In case this events is now said to be all-day,
     // we automatically enforce a 25% zoom-factor and disable the control.
-    var zoom = document.getElementById("zoom-menulist");
+    let zoom = document.getElementById("zoom-menulist");
     let zoomOut = document.getElementById("zoom-out-button");
     let zoomIn = document.getElementById("zoom-in-button");
     if (allDay) {
         zoom.value = "400";
         zoom.setAttribute("disabled", "true");
         zoomOut.setAttribute("disabled", "true");
         zoomIn.setAttribute("disabled", "true");
         setZoomFactor(zoom.value);
@@ -639,46 +639,46 @@ function onChangeCalendar(calendar) {
     let freebusy = document.getElementById("freebusy-grid");
     freebusy.onChangeCalendar(calendar);
 }
 
 /**
  * Updates the slot buttons.
  */
 function updateButtons() {
-    var previousButton = document.getElementById("previous-slot");
+    let previousButton = document.getElementById("previous-slot");
     if (gUndoStack.length > 0) {
         previousButton.removeAttribute('disabled');
     } else {
         previousButton.setAttribute('disabled', 'true');
     }
 }
 
 /**
  * Handler function called to advance to the next slot.
  */
 function onNextSlot() {
     // Store the current setting in the undo-stack.
-    var currentSlot = {};
+    let currentSlot = {};
     currentSlot.startTime = gStartDate;
     currentSlot.endTime = gEndDate;
     gUndoStack.push(currentSlot);
 
     // Ask the grid for the next possible timeslot.
-    var grid = document.getElementById("freebusy-grid");
-    var duration = gEndDate.subtractDate(gStartDate);
-    var start = grid.nextSlot();
-    var end = start.clone();
+    let grid = document.getElementById("freebusy-grid");
+    let duration = gEndDate.subtractDate(gStartDate);
+    let start = grid.nextSlot();
+    let end = start.clone();
     end.addDuration(duration);
     if (start.isDate) {
         end.day++;
     }
     gStartDate = start.clone();
     gEndDate = end.clone();
-    var endDate = gEndDate.clone();
+    let endDate = gEndDate.clone();
 
     // Check if an all-day event has been passed in (to adapt endDate).
     if (gStartDate.isDate) {
         gEndDate.day--;
     }
     gStartDate.makeImmutable();
     gEndDate.makeImmutable();
     endDate.makeImmutable();
@@ -690,59 +690,59 @@ function onNextSlot() {
 
     updateButtons();
 }
 
 /**
  * Handler function called to advance to the previous slot.
  */
 function onPreviousSlot() {
-    var previousSlot = gUndoStack.pop();
+    let previousSlot = gUndoStack.pop();
     if (!previousSlot) {
         return;
     }
 
     // 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 information.
-    var refresh = previousSlot.startTime.day != gStartDate.day;
+    let refresh = previousSlot.startTime.day != gStartDate.day;
 
     gStartDate = previousSlot.startTime.clone();
     gEndDate = previousSlot.endTime.clone();
-    var endDate = gEndDate.clone();
+    let endDate = gEndDate.clone();
 
     propagateDateTime();
 
     // scroll the grid/timebar such that the current time is visible
     scrollToCurrentTime();
 
     updateButtons();
 
     if (refresh) {
-        var grid = document.getElementById("freebusy-grid");
+        let grid = document.getElementById("freebusy-grid");
         grid.forceRefresh();
     }
 }
 
 /**
  * Scrolls the time grid to a position where the time of the item in question is
  * visible.
  */
 function scrollToCurrentTime() {
-    var timebar = document.getElementById("timebar");
-    var ratio = (gStartDate.hour - gStartHour - 1) * timebar.step;
+    let timebar = document.getElementById("timebar");
+    let ratio = (gStartDate.hour - gStartHour - 1) * timebar.step;
     if (ratio <= 0.0) {
         ratio = 0.0;
     }
     if (ratio >= 1.0) {
         ratio = 1.0;
     }
-    var scrollbar = document.getElementById("horizontal-scrollbar");
-    var maxpos = scrollbar.getAttribute("maxpos");
+    let scrollbar = document.getElementById("horizontal-scrollbar");
+    let maxpos = scrollbar.getAttribute("maxpos");
     scrollbar.setAttribute("curpos", ratio * maxpos);
 }
 
 
 /**
  * Sets the zoom factor for the time grid
  *
  * @param aValue        The zoom factor to set.
@@ -760,33 +760,33 @@ function setZoomFactor(aValue) {
     applyCurrentZoomFactor();
     return aValue;
 }
 
 /**
  * applies the current zoom factor for the time grid
  */
 function applyCurrentZoomFactor() {
-    var timebar = document.getElementById("timebar");
+    let timebar = document.getElementById("timebar");
     timebar.zoomFactor = gZoomFactor;
-    var selectionbar = document.getElementById("selection-bar");
+    let selectionbar = document.getElementById("selection-bar");
     selectionbar.zoomFactor = gZoomFactor;
-    var grid = document.getElementById("freebusy-grid");
+    let grid = document.getElementById("freebusy-grid");
     grid.zoomFactor = gZoomFactor;
 
     // Calling onResize() will update the scrollbars and everything else
     // that needs to adopt the previously made changes. We need to call
     // this after the changes have actually been made...
     onResize();
 
-    var scrollbar = document.getElementById("horizontal-scrollbar");
+    let scrollbar = document.getElementById("horizontal-scrollbar");
     if (scrollbar.hasAttribute("maxpos")) {
-        var curpos = scrollbar.getAttribute("curpos");
-        var maxpos = scrollbar.getAttribute("maxpos");
-        var ratio = curpos / maxpos;
+        let curpos = scrollbar.getAttribute("curpos");
+        let maxpos = scrollbar.getAttribute("maxpos");
+        let ratio = curpos / maxpos;
         timebar.scroll = ratio;
         grid.scroll = ratio;
         selectionbar.ratio = ratio;
     }
 }
 
 /**
  * Force the time grid to show 24 hours.
@@ -796,35 +796,35 @@ function applyCurrentZoomFactor() {
  */
 function setForce24Hours(aValue) {
     if (gForce24Hours == aValue) {
       return aValue;
     }
 
     gForce24Hours = aValue;
     initTimeRange();
-    var timebar = document.getElementById("timebar");
+    let timebar = document.getElementById("timebar");
     timebar.force24Hours = gForce24Hours;
-    var selectionbar = document.getElementById("selection-bar");
+    let selectionbar = document.getElementById("selection-bar");
     selectionbar.force24Hours = gForce24Hours;
-    var grid = document.getElementById("freebusy-grid");
+    let grid = document.getElementById("freebusy-grid");
     grid.force24Hours = gForce24Hours;
 
     // Calling onResize() will update the scrollbars and everything else
     // that needs to adopt the previously made changes. We need to call
     // this after the changes have actually been made...
     onResize();
 
-    var scrollbar = document.getElementById("horizontal-scrollbar");
+    let scrollbar = document.getElementById("horizontal-scrollbar");
     if (!scrollbar.hasAttribute("maxpos")) {
         return aValue;
     }
-    var curpos = scrollbar.getAttribute("curpos");
-    var maxpos = scrollbar.getAttribute("maxpos");
-    var ratio = curpos / maxpos;
+    let curpos = scrollbar.getAttribute("curpos");
+    let maxpos = scrollbar.getAttribute("maxpos");
+    let ratio = curpos / maxpos;
     timebar.scroll = ratio;
     grid.scroll = ratio;
     selectionbar.ratio = ratio;
 
     return aValue;
 }
 
 /**
@@ -856,19 +856,19 @@ function onModify(event) {
 
 /**
  * Handler function for the "rowchange" event, emitted from the attendees-list
  * binding. event.details is the row that was changed to.
  *
  * @param event     The DOM event caused by the row change.
  */
 function onRowChange(event) {
-    var scrollbar = document.getElementById("vertical-scrollbar");
-    var attendees = document.getElementById("attendees-list");
-    var maxpos = scrollbar.getAttribute("maxpos");
+    let scrollbar = document.getElementById("vertical-scrollbar");
+    let attendees = document.getElementById("attendees-list");
+    let maxpos = scrollbar.getAttribute("maxpos");
     scrollbar.setAttribute(
         "curpos",
         event.details / attendees.mMaxAttendees * maxpos);
 }
 
 /**
  * Handler function to take care of mouse scrolling on the window
  *
@@ -952,34 +952,34 @@ function onTimebar(event) {
 /**
  * Handler function to update controls when the time has changed on the
  * selection bar.
  *
  * @param event     The "timechange" event with startDate and endDate
  *                    properties.
  */
 function onTimeChange(event) {
-    var start = event.startDate.getInTimezone(gStartTimezone);
-    var end = event.endDate.getInTimezone(gEndTimezone);
+    let start = event.startDate.getInTimezone(gStartTimezone);
+    let end = event.endDate.getInTimezone(gEndTimezone);
 
     loadDateTime(start, end);
 
     // fill the controls
     updateDateTime();
 
     // tell the timebar about the new start/enddate
-    var timebar = document.getElementById("timebar");
+    let timebar = document.getElementById("timebar");
     timebar.startDate = gStartDate;
     timebar.endDate = gEndDate;
     timebar.refresh();
 
     // tell the freebusy grid about the new start/enddate
-    var grid = document.getElementById("freebusy-grid");
+    let grid = document.getElementById("freebusy-grid");
 
-    var refresh = (grid.startDate == null) ||
+    let refresh = (grid.startDate == null) ||
                   (grid.startDate.compare(gStartDate) != 0) ||
                   (grid.endDate == null) ||
                   (grid.endDate.compare(gEndDate) != 0);
     grid.startDate = gStartDate;
     grid.endDate = gEndDate;
     if (refresh) {
         grid.forceRefresh();
     }
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -66,68 +66,68 @@
 
       <constructor><![CDATA[
         Components.utils.import("resource://calendar/modules/calUtils.jsm");
         Components.utils.import("resource://gre/modules/Services.jsm");
         Components.utils.import("resource:///modules/mailServices.js");
 
         this.mMaxAttendees = 0;
 
-        var self = this;
-        var load = function loadHandler() {
+        let self = this;
+        let load = function loadHandler() {
             self.onLoad();
         };
         window.addEventListener("load", load, true);
       ]]></constructor>
 
       <method name="onLoad">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var template =
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "item");
 
           this.onInitialize();
 
           // this trigger the continous update chain, which
           // effectively calls this.onModify() on predefined
           // time intervals [each second].
-          var self = this;
-          var callback = function() {
+          let self = this;
+          let callback = function() {
               setTimeout(callback, 1000);
               self.onModify();
           };
           callback();
         ]]></body>
       </method>
 
       <method name="onInitialize">
         <body><![CDATA[
-          var args = window.arguments[0];
-          var organizer = args.organizer;
-          var attendees = args.attendees;
-          var calendar = args.calendar;
+          let args = window.arguments[0];
+          let organizer = args.organizer;
+          let attendees = args.attendees;
+          let calendar = args.calendar;
 
           this.mIsReadOnly = calendar.readOnly;
 
           // assume we're the organizer [in case that the calendar
           // does not support the concept of identities].
-          var organizerID = ((organizer && organizer.id)
+          let organizerID = ((organizer && organizer.id)
                              ? organizer.id
                              : calendar.getProperty("organizerId"));
 
           calendar = cal.wrapInstance(calendar, Components.interfaces.calISchedulingSupport);
           this.mIsInvitation = (calendar && calendar.isInvitation(args.item));
 
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var template =
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "item");
           template.focus();
 
           if (this.mIsReadOnly || this.mIsInvitation) {
               listbox.setAttribute("disabled", "true");
           }
 
@@ -153,19 +153,19 @@
               }
               if (!organizer.commonName || !organizer.commonName.length) {
                   organizer.commonName = calendar.getProperty("organizerCN");
               }
               organizer.isOrganizer = true;
               this.appendAttendee(organizer, listbox, template, true);
           }
 
-          var numRowsAdded = 0;
+          let numRowsAdded = 0;
           if (attendees.length > 0) {
-              for (var attendee of attendees) {
+              for (let attendee of attendees) {
                   this.appendAttendee(attendee, listbox, template, false);
                   numRowsAdded++;
               }
           }
           if (numRowsAdded == 0) {
               this.appendAttendee(null, listbox, template, false);
           }
 
@@ -180,25 +180,25 @@
       <!-- appends a new row using an existing attendee structure -->
       <method name="appendAttendee">
         <parameter name="aAttendee"/>
         <parameter name="aParentNode"/>
         <parameter name="aTemplateNode"/>
         <parameter name="aDisableIfOrganizer"/>
         <body><![CDATA[
           // create a new listbox item and append it to our parent control.
-          var newNode = aTemplateNode.cloneNode(true);
+          let newNode = aTemplateNode.cloneNode(true);
 
-          var input =
+          let input =
               document.getAnonymousElementByAttribute(
                   newNode, "anonid", "input");
-          var roleStatusIcon =
+          let roleStatusIcon =
               document.getAnonymousElementByAttribute(
                   newNode, "anonid", "rolestatus-icon");
-          var userTypeIcon =
+          let userTypeIcon =
               document.getAnonymousElementByAttribute(
                   newNode, "anonid", "usertype-icon");
 
           // We always clone the first row. The problem is that the first row
           // could be focused. When we clone that row, we end up with a cloned
           // XUL textbox that has a focused attribute set.  Therefore we think
           // we're focused and don't properly refocus.  The best solution to this
           // would be to clone a template row that didn't really have any presentation,
@@ -225,17 +225,17 @@
 
           // disable the input-field [name <email>] if this attendee
           // appears to be the organizer.
           if (aDisableIfOrganizer && aAttendee && aAttendee.isOrganizer) {
               input.setAttribute("disabled", "true");
           }
 
           this.mMaxAttendees++;
-          var rowNumber = this.mMaxAttendees;
+          let rowNumber = this.mMaxAttendees;
           if (rowNumber >= 0) {
               roleStatusIcon.setAttribute("id", "attendeeCol1#" + rowNumber);
               userTypeIcon.setAttribute("id", "attendeeCol2#" + rowNumber);
               input.setAttribute("id", "attendeeCol3#" + rowNumber);
           }
 
           if (!aAttendee) {
               aAttendee = this.createAttendee();
@@ -284,59 +284,59 @@
           return true;
         ]]></body>
       </method>
 
       <method name="appendNewRow">
         <parameter name="aSetFocus"/>
         <parameter name="aInsertAfter"/>
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var listitem1 = this.getListItem(1);
-          var newNode = null;
+          let listitem1 = this.getListItem(1);
+          let newNode = null;
 
           if (listbox && listitem1) {
-              var newAttendee = this.createAttendee();
-              var nextDummy = this.getNextDummyRow();
+              let newAttendee = this.createAttendee();
+              let nextDummy = this.getNextDummyRow();
               newNode = listitem1.cloneNode(true);
 
               if (aInsertAfter) {
                   listbox.insertBefore(newNode, aInsertAfter.nextSibling);
               } else if (nextDummy) {
                   listbox.replaceChild(newNode, nextDummy);
               } else {
                   listbox.appendChild(newNode);
               }
 
-              var input =
+              let input =
                   document.getAnonymousElementByAttribute(
                       newNode, "anonid", "input");
-              var roleStatusIcon =
+              let roleStatusIcon =
                   document.getAnonymousElementByAttribute(
                       newNode, "anonid", "rolestatus-icon");
-              var userTypeIcon =
+              let userTypeIcon =
                   document.getAnonymousElementByAttribute(
                       newNode, "anonid", "usertype-icon");
 
               // the template could have its fields disabled,
               // that's why we need to reset their status.
               input.removeAttribute("disabled");
               roleStatusIcon.removeAttribute("disabled");
               userTypeIcon.removeAttribute("disabled");
 
               if (this.mIsReadOnly || this.mIsInvitation) {
                   input.setAttribute("disabled", "true");
                   roleStatusIcon.setAttribute("disabled", "true");
                   userTypeIcon.setAttribute("disabled", "true");
               }
 
               this.mMaxAttendees++;
-              var rowNumber = this.mMaxAttendees;
+              let rowNumber = this.mMaxAttendees;
               if (rowNumber >= 0) {
                   roleStatusIcon.setAttribute("id", "attendeeCol1#" + rowNumber);
                   userTypeIcon.setAttribute("id", "attendeeCol2#" + rowNumber);
                   input.setAttribute("id", "attendeeCol3#" + rowNumber);
               }
 
               input.value = null;
               input.removeAttribute("value");
@@ -509,17 +509,17 @@
                 if (aList[l] === listid) {
                   return true;
                 }
               }
               return false;
             }
 
             let addressLists = mailingList.addressLists;
-            for (var i = 0; i < addressLists.length; i++) {
+            for (let i = 0; i < addressLists.length; i++) {
               let abCard = addressLists.queryElementAt(i, Components.interfaces.nsIAbCard);
               let thisId = abCard.primaryEmail;
               if (abCard.displayName.length > 0) {
                   let rCn = abCard.displayName;
                   if (rCn.includes(",")) {
                       rCn = '"' + rCn + '"';
                   }
                   thisId = rCn + " <" + thisId + ">";
@@ -709,53 +709,53 @@
       <property name="documentSize">
         <getter><![CDATA[
             return this.mRowHeight * this.mMaxAttendees;
         ]]></getter>
       </property>
 
       <method name="fitDummyRows">
         <body><![CDATA[
-          var self = this;
-          var func = function attendees_list_fitDummyRows() {
+          let self = this;
+          let func = function attendees_list_fitDummyRows() {
               self.calcContentHeight();
               self.createOrRemoveDummyRows();
           };
           setTimeout(func, 0);
         ]]></body>
       </method>
 
       <method name="calcContentHeight">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var items = listbox.getElementsByTagNameNS('*', 'listitem');
+          let items = listbox.getElementsByTagNameNS('*', 'listitem');
           this.mContentHeight = 0;
           if (items.length > 0) {
-              var i = 0;
+              let i = 0;
               do {
                   this.mRowHeight = items[i].boxObject.height;
                   ++i;
               } while (i < items.length && !this.mRowHeight);
               this.mContentHeight = this.mRowHeight * items.length;
           }
         ]]></body>
       </method>
 
       <method name="createOrRemoveDummyRows">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var listboxHeight = listbox.boxObject.height;
+          let listboxHeight = listbox.boxObject.height;
 
           // remove rows to remove scrollbar
-          var kids = listbox.childNodes;
-          for (var i = kids.length - 1; this.mContentHeight > listboxHeight && i >= 0; --i) {
+          let kids = listbox.childNodes;
+          for (let i = kids.length - 1; this.mContentHeight > listboxHeight && i >= 0; --i) {
               if (kids[i].hasAttribute("_isDummyRow")) {
                   this.mContentHeight -= this.mRowHeight;
                   kids[i].remove();
               }
           }
 
           // add rows to fill space
           if (this.mRowHeight) {
@@ -765,66 +765,66 @@
               }
           }
         ]]></body>
       </method>
 
       <method name="createDummyCell">
         <parameter name="aParent"/>
         <body><![CDATA[
-          var cell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listcell");
+          let cell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listcell");
           cell.setAttribute("class", "addressingWidgetCell dummy-row-cell");
           if (aParent) {
               aParent.appendChild(cell);
           }
           return cell;
         ]]></body>
       </method>
 
       <method name="createDummyItem">
         <parameter name="aParent"/>
         <body><![CDATA[
-          var titem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listitem");
+          let titem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listitem");
           titem.setAttribute("_isDummyRow", "true");
           titem.setAttribute("class", "dummy-row");
-          for (var i = this.numColumns; i > 0; i--) {
+          for (let i = this.numColumns; i > 0; i--) {
               this.createDummyCell(titem);
           }
           if (aParent) {
               aParent.appendChild(titem);
           }
           return titem;
         ]]></body>
       </method>
 
       <!-- gets the next row from the top down -->
       <method name="getNextDummyRow">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var kids = listbox.childNodes;
-          for (var i = 0; i < kids.length; ++i) {
+          let kids = listbox.childNodes;
+          for (let i = 0; i < kids.length; ++i) {
               if (kids[i].hasAttribute("_isDummyRow")) {
                   return kids[i];
               }
           }
           return null;
         ]]></body>
       </method>
 
       <!-- This method returns the <xul:listitem> at row numer 'aRow' -->
       <method name="getListItem">
         <parameter name="aRow"/>
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           if (listbox && aRow > 0) {
-              var listitems = listbox.getElementsByTagNameNS('*', 'listitem');
+              let listitems = listbox.getElementsByTagNameNS('*', 'listitem');
               if (listitems && listitems.length >= aRow) {
                   return listitems[aRow - 1];
               }
           }
           return 0;
         ]]></body>
       </method>
 
@@ -833,17 +833,17 @@
         <body><![CDATA[
           return aListItem.getElementsByTagNameNS("*", "textbox")[0];
         ]]></body>
       </method>
 
       <method name="getRowByInputElement">
         <parameter name="aElement"/>
         <body><![CDATA[
-          var row = 0;
+          let row = 0;
           while (aElement && aElement.localName != "listitem") {
               aElement = aElement.parentNode;
           }
           if (aElement) {
               while (aElement) {
                   if (aElement.localName == "listitem") {
                       ++row;
                   }
@@ -882,89 +882,89 @@
         <body><![CDATA[
           return document.getAnonymousElementByAttribute(this, "id", "attendeeCol2#" + aRow);
         ]]></body>
       </method>
 
       <method name="setFocus">
         <parameter name="aRow"/>
         <body><![CDATA[
-          var self = this;
-          var set_focus = function() {
-              var node;
+          let self = this;
+          let set_focus = function() {
+              let node;
               if (typeof aRow == 'number') {
                 node = self.getListItem(aRow);
               } else {
                 node = aRow;
               }
 
               // do we need to scroll in order to see the selected row?
-              var listbox =
+              let listbox =
                   document.getAnonymousElementByAttribute(
                       self, "anonid", "listbox");
-              var firstVisibleRow = listbox.getIndexOfFirstVisibleRow();
-              var numOfVisibleRows = listbox.getNumberOfVisibleRows();
+              let firstVisibleRow = listbox.getIndexOfFirstVisibleRow();
+              let numOfVisibleRows = listbox.getNumberOfVisibleRows();
               if (aRow <= firstVisibleRow) {
                   listbox.scrollToIndex(aRow - 1);
               } else {
                   if (aRow - 1 >= (firstVisibleRow + numOfVisibleRows)) {
                       listbox.scrollToIndex(aRow - numOfVisibleRows);
                   }
               }
-              var input =
+              let input =
                   document.getAnonymousElementByAttribute(
                       node, "anonid", "input");
               input.focus();
           };
           setTimeout(set_focus, 0);
         ]]></body>
       </method>
 
       <property name="firstVisibleRow">
         <getter><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           return listbox.getIndexOfFirstVisibleRow();
         ]]></getter>
       </property>
 
       <method name="createAttendee">
         <body><![CDATA[
-          var attendee = createAttendee();
+          let attendee = createAttendee();
           attendee.id = "";
           attendee.rsvp = "TRUE";
           attendee.role = "REQ-PARTICIPANT";
           attendee.participationStatus = "NEEDS-ACTION";
           return attendee;
         ]]></body>
       </method>
 
       <property name="numColumns">
         <getter><![CDATA[
           if (!this.mNumColumns) {
-              var listbox =
+              let listbox =
                   document.getAnonymousElementByAttribute(
                       this, "anonid", "listbox");
-              var listCols = listbox.getElementsByTagNameNS('*', 'listcol');
+              let listCols = listbox.getElementsByTagNameNS('*', 'listcol');
               this.mNumColumns = listCols.length;
               if (!this.mNumColumns) {
                   this.mNumColumns = 1;
               }
           }
           return this.mNumColumns;
         ]]></getter>
       </property>
 
       <property name="ratio">
         <setter><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var rowcount = listbox.getRowCount();
+          let rowcount = listbox.getRowCount();
           listbox.scrollToIndex(Math.floor(rowcount * val));
           return val;
         ]]></setter>
       </property>
 
       <method name="returnHit">
         <parameter name="element"/>
         <parameter name="noAdvance"/>
@@ -1005,81 +1005,81 @@
           }
         ]]></body>
       </method>
 
       <method name="arrowHit">
         <parameter name="aElement"/>
         <parameter name="aDirection"/>
         <body><![CDATA[
-          var row = this.getRowByInputElement(aElement) + aDirection;
+          let row = this.getRowByInputElement(aElement) + aDirection;
           if (row) {
               if (row > this.mMaxAttendees) {
                   this.appendNewRow(true);
               } else {
-                  var input = this.getInputElement(row);
+                  let input = this.getInputElement(row);
                   if (input.hasAttribute("disabled")) {
                       return;
                   }
                   this.setFocus(row);
               }
-              var event = document.createEvent('Events');
+              let event = document.createEvent('Events');
               event.initEvent('rowchange', true, false);
               event.details = row;
               this.dispatchEvent(event);
           }
         ]]></body>
       </method>
 
       <method name="deleteHit">
         <parameter name="aElement"/>
         <body><![CDATA[
           // don't delete the row if only the organizer is remaining
           if (this.mMaxAttendees <= 1) {
               return;
           }
 
-          var row = this.getRowByInputElement(aElement);
+          let row = this.getRowByInputElement(aElement);
           this.deleteRow(row);
           if (row > 0) {
               row = row - 1;
           }
           this.setFocus(row);
           this.onModify();
 
-          var event = document.createEvent('Events');
+          let event = document.createEvent('Events');
           event.initEvent('rowchange', true, false);
           event.details = row;
           this.dispatchEvent(event);
         ]]></body>
       </method>
 
       <method name="deleteRow">
         <parameter name="aRow"/>
         <body><![CDATA[
           // reset id's in order to not break the sequence
-          var maxAttendees = this.mMaxAttendees;
+          let maxAttendees = this.mMaxAttendees;
           this.removeRow(aRow);
-          var numberOfCols = this.numColumns;
-          for (var row = aRow + 1; row <= maxAttendees; row++) {
-              for (var col = 1; col <= numberOfCols; col++) {
-                  var colID = "attendeeCol" + col + "#" + row;
-                  var elem = document.getAnonymousElementByAttribute(this, "id", colID);
+          let numberOfCols = this.numColumns;
+          for (let row = aRow + 1; row <= maxAttendees; row++) {
+              for (let col = 1; col <= numberOfCols; col++) {
+                  let colID = "attendeeCol" + col + "#" + row;
+                  let elem = document.getAnonymousElementByAttribute(this, "id", colID);
                   if (elem) {
                       elem.setAttribute("id", "attendeeCol" + col + "#" + (row - 1));
                   }
               }
           }
         ]]></body>
       </method>
 
       <method name="removeRow">
         <parameter name="aRow"/>
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           this.getListItem(aRow).remove();
           this.fitDummyRows();
           this.mMaxAttendees--;
         ]]></body>
       </method>
     </implementation>
@@ -1298,49 +1298,49 @@
                 this, "anonid", "selection-bar");
       ]]></constructor>
 
       <property name="baseDate">
         <setter><![CDATA[
           // we need to convert the date/time in question in
           // order to calculate with hours that are aligned
           // with our timebar display.
-          var kDefaultTimezone = calendarDefaultTimezone();
+          let kDefaultTimezone = calendarDefaultTimezone();
           this.mBaseDate = val.getInTimezone(kDefaultTimezone);
           this.mBaseDate.isDate = true;
           this.mBaseDate.makeImmutable();
           return val;
         ]]></setter>
       </property>
 
       <property name="startDate">
         <setter><![CDATA[
           // currently we *always* set the basedate to be
           // equal to the startdate. we'll most probably
           // want to change this later.
           this.baseDate = val;
           // we need to convert the date/time in question in
           // order to calculate with hours that are aligned
           // with our timebar display.
-          var kDefaultTimezone = calendarDefaultTimezone();
+          let kDefaultTimezone = calendarDefaultTimezone();
           this.mStartDate = val.getInTimezone(kDefaultTimezone);
           this.mStartDate.makeImmutable();
           return val;
         ]]></setter>
         <getter><![CDATA[
           return this.mStartDate;
         ]]></getter>
       </property>
 
       <property name="endDate">
         <setter><![CDATA[
           // we need to convert the date/time in question in
           // order to calculate with hours that are aligned
           // with our timebar display.
-          var kDefaultTimezone = calendarDefaultTimezone();
+          let kDefaultTimezone = calendarDefaultTimezone();
           this.mEndDate = val.getInTimezone(kDefaultTimezone);
           if (this.mEndDate.isDate) {
               this.mEndDate.day += 1;
           }
           this.mEndDate.makeImmutable();
           return val;
         ]]></setter>
         <getter><![CDATA[
@@ -1380,20 +1380,20 @@
         ]]></body>
       </method>
 
       <!-- given some specific date this method calculates the
            corrposonding offset in fractional hours -->
       <method name="date2offset">
         <parameter name="date"/>
         <body><![CDATA[
-          var num_hours = this.mEndHour - this.mStartHour;
-          var diff = date.subtractDate(this.mBaseDate);
-          var offset = diff.days * num_hours;
-          var hours = (diff.hours - this.mStartHour) + (diff.minutes / 60.0);
+          let num_hours = this.mEndHour - this.mStartHour;
+          let diff = date.subtractDate(this.mBaseDate);
+          let offset = diff.days * num_hours;
+          let hours = (diff.hours - this.mStartHour) + (diff.minutes / 60.0);
           if (hours < 0) {
               hours = 0;
           }
           if (hours > num_hours) {
               hours = num_hours;
           }
           offset += hours;
           return offset;
@@ -1402,73 +1402,73 @@
 
       <method name="update">
         <body><![CDATA[
           if (!this.mStartDate || !this.mEndDate) {
               return;
           }
 
           // Calculate the relation of startdate/basedate and enddate/startdate.
-          var offset = this.mStartDate.subtractDate(this.mBaseDate);
-          var duration = this.mEndDate.subtractDate(this.mStartDate);
+          let offset = this.mStartDate.subtractDate(this.mBaseDate);
+          let duration = this.mEndDate.subtractDate(this.mStartDate);
 
           // Calculate how much pixels a single hour and a single day take up.
-          var num_hours = this.mEndHour - this.mStartHour;
-          var hour_width = this.mContentWidth / num_hours;
+          let num_hours = this.mEndHour - this.mStartHour;
+          let hour_width = this.mContentWidth / num_hours;
 
           // Calculate the offset in fractional hours that corrospond
           // to our start- and end-time.
-          var start_offset_in_hours = this.date2offset(this.mStartDate);
-          var end_offset_in_hours = this.date2offset(this.mEndDate);
-          var duration_in_hours = end_offset_in_hours - start_offset_in_hours;
+          let start_offset_in_hours = this.date2offset(this.mStartDate);
+          let end_offset_in_hours = this.date2offset(this.mEndDate);
+          let duration_in_hours = end_offset_in_hours - start_offset_in_hours;
 
           // Calculate width & margin for the selection bar based on the
           // relation of startdate/basedate and enddate/startdate.
           // This is a simple conversion from hours to pixels.
           this.mWidth = duration_in_hours * hour_width;
-          var totaldragwidths = this.leftdragWidth + this.rightdragWidth;
+          let totaldragwidths = this.leftdragWidth + this.rightdragWidth;
           if (this.mWidth < totaldragwidths) {
               this.mWidth = totaldragwidths;
           }
           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;
+          let total_width = this.mContentWidth * this.mRange - this.parentNode.boxObject.width;
 
           // Calculate the current scroll offset.
           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 +
+          let style = "width: " + this.mWidth +
                       "px; margin-inline-start: " + this.mMargin +
                       "px; margin-top: " + this.mHeaderHeight + "px;";
           this.mSelectionbar.setAttribute("style", style);
 
-          var event = document.createEvent('Events');
+          let event = document.createEvent('Events');
           event.initEvent('timechange', true, false);
           event.startDate = this.mStartDate;
           event.endDate = this.mEndDate.clone();
           if (event.endDate.isDate) {
               event.endDate.day--;
           }
           event.endDate.makeImmutable();
           this.dispatchEvent(event);
         ]]></body>
       </method>
 
       <method name="setWidth">
         <parameter name="width"/>
         <body><![CDATA[
-            var scrollbox =
+            let scrollbox =
                 document.getAnonymousElementByAttribute(
                     this, "anonid", "scrollbox");
             scrollbox.setAttribute("width", width);
         ]]></body>
       </method>
 
       <method name="initTimeRange">
         <body><![CDATA[
@@ -1482,26 +1482,26 @@
         ]]></body>
       </method>
 
       <method name="moveTime">
         <parameter name="time"/>
         <parameter name="delta"/>
         <parameter name="doclip"/>
         <body><![CDATA[
-          var newTime = time.clone();
-          var clip_minutes = 60 * this.zoomFactor / 100;
+          let newTime = time.clone();
+          let clip_minutes = 60 * this.zoomFactor / 100;
           if (newTime.isDate) {
               clip_minutes = 60 * 24;
           }
-          var num_hours = this.mEndHour - this.mStartHour;
-          var hour_width = this.mContentWidth / num_hours;
-          var minutes_per_pixel = 60 / hour_width;
-          var minute_shift = minutes_per_pixel * delta;
-          var isClipped = Math.abs(minute_shift) >= (this.mfClipRatio * clip_minutes);
+          let num_hours = this.mEndHour - this.mStartHour;
+          let hour_width = this.mContentWidth / num_hours;
+          let minutes_per_pixel = 60 / hour_width;
+          let minute_shift = minutes_per_pixel * delta;
+          let isClipped = Math.abs(minute_shift) >= (this.mfClipRatio * clip_minutes);
           if (isClipped) {
               if (delta > 0) {
                   if (time.isDate) {
                       newTime.day++;
                   } else {
                       if (doclip) {
                           newTime.minute -= newTime.minute % clip_minutes;
                       }
@@ -1532,19 +1532,19 @@
 
           return newTime;
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="mousedown"><![CDATA[
-        var element = event.target;
+        let element = event.target;
         this.mMouseX = event.screenX;
-        var mouseX = event.clientX - element.boxObject.x;
+        let mouseX = event.clientX - element.boxObject.x;
 
         if (mouseX >= this.mMargin) {
             if (mouseX <= (this.mMargin + this.mWidth)) {
                 if (mouseX <= (this.mMargin + this.leftdragWidth)) {
                     // Move the startdate only...
                     window.setCursor("w-resize");
                     this.mDragState = 2;
                 } else if (mouseX >= (this.mMargin + this.mWidth - (this.rightdragWidth))) {
@@ -1556,17 +1556,17 @@
                     this.mDragState = 1;
                     window.setCursor("grab");
                 }
             }
         }
       ]]></handler>
 
       <handler event="mousemove"><![CDATA[
-        var mouseX = event.screenX;
+        let mouseX = event.screenX;
         if (this.mDragState == 1) {
             // Move the startdate and the enddate
             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
--- a/calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
@@ -30,28 +30,28 @@
           <children/>
         </xul:box>
       </xul:box>
     </content>
 
     <implementation>
       <property name="x">
         <setter><![CDATA[
-          var content =
+          let content =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "content");
           content.setAttribute("style",
                                "margin-inline-start: " + (-val) + "px;");
           return val;
         ]]></setter>
       </property>
 
       <property name="y">
         <setter><![CDATA[
-          var content =
+          let content =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "content");
           content.setAttribute("style",
                                "margin-top: " + (-val) + "px;");
           return val;
         ]]></setter>
       </property>
     </implementation>
@@ -140,26 +140,26 @@
           this.mEndDate = val.clone();
           this.mEndDate.makeImmutable();
           return val;
         ]]></setter>
       </property>
 
       <property name="dayHeight">
         <getter><![CDATA[
-          var day =
+          let day =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "day");
           return day.boxObject.height;
         ]]></getter>
       </property>
 
       <property name="date">
         <setter><![CDATA[
-          var date = val.clone();
+          let date = val.clone();
           date.hour = 0;
           date.minute = 0;
           date.isDate = false;
 
           if (!this.mDateFormatter) {
               this.mDateFormatter =
                   Components.classes[
                       "@mozilla.org/calendar/datetime-formatter;1"]
@@ -254,20 +254,20 @@
 
       <property name="zoomFactor">
         <getter><![CDATA[
           return this.mZoomFactor;
         ]]></getter>
         <setter><![CDATA[
           this.mZoomFactor = val;
 
-          var template =
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "template");
-          var parent = template.parentNode;
+          let parent = template.parentNode;
           while (parent.childNodes.length > 1) {
               parent.lastChild.remove();
           }
 
           template.force24Hours = this.mForce24Hours;
           template.zoomFactor = this.mZoomFactor;
 
           this.onLoad();
@@ -279,21 +279,21 @@
       <property name="force24Hours">
         <getter><![CDATA[
           return this.mForce24Hours;
         ]]></getter>
         <setter><![CDATA[
           this.mForce24Hours = val;
           this.initTimeRange();
 
-          var template =
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "template");
 
-          var parent = template.parentNode;
+          let parent = template.parentNode;
           while (parent.childNodes.length > 1) {
             parent.lastChild.remove();
           }
 
           template.force24Hours = this.mForce24Hours;
           template.zoomFactor = this.mZoomFactor;
 
           this.onLoad();
@@ -302,17 +302,17 @@
         ]]></setter>
       </property>
 
       <property name="contentWidth">
         <getter><![CDATA[
           // Calculate the difference between the first to day-elements, since
           // the width of the head element does not specify the width we need
           // due to an arbitrary margin value.
-          var template =
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "template");
           return template.nextSibling.boxObject.x - template.boxObject.x;
         ]]></getter>
       </property>
 
       <property name="containerWidth">
         <getter><![CDATA[
@@ -340,176 +340,176 @@
         <getter><![CDATA[
           return this.mEndDate;
         ]]></getter>
       </property>
 
       <property name="dayOffset">
         <setter><![CDATA[
           this.mDayOffset = val;
-          var container =
+          let container =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "container");
-          var date = this.mStartDate.clone();
+          let date = this.mStartDate.clone();
           date.day += val;
-          var numChilds = container.childNodes.length;
-          for (var i = 0; i < numChilds; i++) {
-              var child = container.childNodes[i];
+          let numChilds = container.childNodes.length;
+          for (let i = 0; i < numChilds; i++) {
+              let child = container.childNodes[i];
               child.date = date;
               date.day++;
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="step">
         <getter><![CDATA[
           // How much pixels spans a single day
-          var oneday = this.contentWidth;
+          let oneday = this.contentWidth;
 
           // The difference in pixels between the content and the container.
-          var shift = (oneday * this.mRange) - (this.containerWidth);
+          let shift = (oneday * this.mRange) - (this.containerWidth);
 
           // What we want to know is the scale of the total shift
           // needed to step one block further. Since the content
           // is divided into 'numHours' equal parts, we can simply state:
-          var numHours = this.mEndHour - this.mStartHour;
+          let numHours = this.mEndHour - this.mStartHour;
           return (this.contentWidth) / (numHours * shift);
         ]]></getter>
       </property>
 
       <property name="scroll">
         <setter><![CDATA[
           this.mScrollOffset = val;
 
           // How much pixels spans a single day
-          var oneday = this.contentWidth;
+          let oneday = this.contentWidth;
 
           // The difference in pixels between the content and the container.
-          var shift = (oneday * this.mRange) - (this.containerWidth);
+          let shift = (oneday * this.mRange) - (this.containerWidth);
 
           // Now calculate the (positive) offset in pixels which the content
           // needs to be shifted. This is a simple scaling in one dimension.
-          var offset = Math.floor(val * shift);
+          let offset = Math.floor(val * shift);
 
           // Now find out how much days this offset effectively skips.
           // this is a simple division which always yields a positive integer value.
           this.dayOffset = (offset - (offset % oneday)) / oneday;
 
           // Set the pixel offset for the content which will always need
           // to be in the range [0 <= offset <= oneday].
           offset %= oneday;
 
           // Set the offset at the content node.
-          var container =
+          let container =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "container");
           container.x = offset;
           return val;
         ]]></setter>
         <getter><![CDATA[
           return this.mScrollOffset;
         ]]></getter>
       </property>
 
       <constructor><![CDATA[
         Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-        var args = window.arguments[0];
-        var startTime = args.startTime;
-        var endTime = args.endTime;
+        let args = window.arguments[0];
+        let startTime = args.startTime;
+        let endTime = args.endTime;
 
         this.initTimeRange();
 
         // The basedate is the date/time from which the display
         // of the timebar starts. The range is the number of days
         // we should be able to show. The start- and enddate
         // is the time the event is scheduled for.
-        var kDefaultTimezone = calendarDefaultTimezone();
+        let kDefaultTimezone = calendarDefaultTimezone();
         this.startDate = startTime.getInTimezone(kDefaultTimezone);
         this.endDate = endTime.getInTimezone(kDefaultTimezone);
         this.mRange = Number(this.getAttribute("range"));
 
-        var self = this;
-        var load = function loadHandler() {
+        let self = this;
+        let load = function loadHandler() {
             self.onLoad();
         };
         window.addEventListener("load", load, true);
       ]]></constructor>
 
       <method name="refresh">
         <body><![CDATA[
-          var date = this.mStartDate.clone();
-          var template =
+          let date = this.mStartDate.clone();
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "template");
-          var parent = template.parentNode;
-          var numChilds = parent.childNodes.length;
-          for (var i = 0; i < numChilds; i++) {
-              var child = parent.childNodes[i];
+          let parent = template.parentNode;
+          let numChilds = parent.childNodes.length;
+          for (let i = 0; i < numChilds; i++) {
+              let child = parent.childNodes[i];
               child.startDate = this.mStartDate;
               child.endDate = this.mEndDate;
               child.date = date;
               date.day++;
           }
-          var offset = this.mDayOffset;
+          let offset = this.mDayOffset;
           this.dayOffset = offset;
         ]]></body>
       </method>
 
       <method name="onLoad">
         <body><![CDATA[
             this.initialize();
-            var template =
+            let template =
                 document.getAnonymousElementByAttribute(
                     this, "anonid", "template");
-            var event = document.createEvent('Events');
+            let event = document.createEvent('Events');
             event.initEvent('timebar', true, false);
             event.details = this.contentWidth;
             event.height = template.dayHeight;
             this.dispatchEvent(event);
         ]]></body>
       </method>
 
       <method name="initialize">
         <body><![CDATA[
-          var args = window.arguments[0];
-          var startTime = args.startTime;
-          var endTime = args.endTime;
-          var calendar = args.calendar;
+          let args = window.arguments[0];
+          let startTime = args.startTime;
+          let endTime = args.endTime;
+          let calendar = args.calendar;
 
-          var kDefaultTimezone = calendarDefaultTimezone();
+          let kDefaultTimezone = calendarDefaultTimezone();
           this.startDate = startTime.getInTimezone(kDefaultTimezone);
           this.endDate = endTime.getInTimezone(kDefaultTimezone);
 
           // Set the number of 'freebusy-day'-elements
           // we need to fill up the content box.
           // TODO: hardcoded value
           this.mNumDays = 4 * this.mZoomFactor / 100;
           if (this.mNumDays < 2) {
               this.mNumDays = 2;
           }
 
           // Now create those elements and set their date property.
-          var date = this.mStartDate.clone();
-          var template =
+          let date = this.mStartDate.clone();
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "template");
           template.force24Hours = this.mForce24Hours;
           template.zoomFactor = this.mZoomFactor;
           template.startDate = this.mStartDate;
           template.endDate = this.mEndDate;
           template.date = date;
-          var parent = template.parentNode;
+          let parent = template.parentNode;
           if (parent.childNodes.length <= 1) {
-              var count = this.mNumDays - 1;
+              let count = this.mNumDays - 1;
               if (count > 0) {
-                  for (var i = 0; i < count; i++) {
+                  for (let i = 0; i < count; i++) {
                       date.day++;
-                      var newNode = template.cloneNode(false);
+                      let newNode = template.cloneNode(false);
                       newNode.force24Hours = this.mForce24Hours;
                       newNode.zoomFactor = this.mZoomFactor;
                       newNode.startDate = this.mStartDate;
                       newNode.endDate = this.mEndDate;
                       newNode.date = date;
                       parent.appendChild(newNode);
                   }
               }
@@ -601,24 +601,24 @@
           this.mEndDate.isDate = false;
           this.mEndDate.makeImmutable();
           return val;
         ]]></setter>
       </property>
 
       <property name="numHours">
         <getter><![CDATA[
-          var numHours = this.mEndHour - this.mStartHour;
+          let numHours = this.mEndHour - this.mStartHour;
           return Math.ceil(numHours * 100 / this.mZoomFactor);
         ]]></getter>
       </property>
 
       <property name="contentWidth">
         <getter><![CDATA[
-          var hours =
+          let hours =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "hours");
           return (hours.childNodes[1].boxObject.x -
                   hours.childNodes[0].boxObject.x) *
                   this.numHours;
         ]]></getter>
       </property>
 
@@ -644,38 +644,38 @@
         <getter><![CDATA[
           return this.contentWidth * this.mRange;
         ]]></getter>
       </property>
 
       <property name="scroll">
         <setter><![CDATA[
           // How much pixels spans a single day
-          var oneday = this.contentWidth;
+          let oneday = this.contentWidth;
           if (oneday <= 0) {
               return val;
           }
 
           // The difference in pixels between the content and the container.
-          var shift = (oneday * this.mRange) - (this.containerWidth);
+          let shift = (oneday * this.mRange) - (this.containerWidth);
 
           // Now calculate the (positive) offset in pixels which the content
           // needs to be shifted. This is a simple scaling in one dimension.
-          var offset = Math.floor(val * shift);
+          let offset = Math.floor(val * shift);
 
           // Now find out how much days this offset effectively skips.
           // this is a simple division which always yields a positive integer value.
           this.dayOffset = (offset - (offset % oneday)) / oneday;
 
           // Set the pixel offset for the content which will always need
           // to be in the range [0 <= offset <= oneday].
           offset %= oneday;
 
           // Set the offset at the content node.
-          var container =
+          let container =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "container");
           container.x = offset;
           return val;
         ]]></setter>
       </property>
 
       <constructor><![CDATA[
@@ -749,24 +749,24 @@
           // which will map the entries to attributes on the xul elements.
           if (aEntries) {
               // Remember the free/busy array which is used to find a
               // new time for an event. We store this array only if
               // the provider returned a valid array. In any other case
               // (temporarily clean the display) we keep the last know result.
               this.mEntries = aEntries;
 
-              var kDefaultTimezone = calendarDefaultTimezone();
+              let kDefaultTimezone = calendarDefaultTimezone();
 
-              var start = this.mStartDate.clone();
+              let start = this.mStartDate.clone();
               start.hour = 0;
               start.minute = 0;
               start.second = 0;
               start.timezone = kDefaultTimezone;
-              var end = start.clone();
+              let end = start.clone();
               end.day += this.mRange;
               end.timezone = kDefaultTimezone;
 
               // First of all set all state slots to 'free'
               for (let i = 0; i < this.mState.length; i++) {
                   this.mState[i] = Components.interfaces.calIFreeBusyInterval.FREE;
               }
 
@@ -897,31 +897,31 @@
         ]]></body>
       </method>
 
       <method name="nextSlot">
         <parameter name="aStartTime"/>
         <parameter name="aEndTime"/>
         <parameter name="allDay"/>
         <body><![CDATA[
-          var newTime = aStartTime.clone();
-          var duration = aEndTime.subtractDate(aStartTime);
-          var newEndTime = newTime.clone();
+          let newTime = aStartTime.clone();
+          let duration = aEndTime.subtractDate(aStartTime);
+          let newEndTime = newTime.clone();
           newEndTime.addDuration(duration);
 
-          var kDefaultTimezone = calendarDefaultTimezone();
+          let kDefaultTimezone = calendarDefaultTimezone();
 
           if (this.mEntries) {
-              for (var entry of this.mEntries) {
-                var rangeStart =
+              for (let entry of this.mEntries) {
+                let rangeStart =
                     entry.interval.start.getInTimezone(kDefaultTimezone);
-                var rangeEnd =
+                let rangeEnd =
                     entry.interval.end.getInTimezone(kDefaultTimezone);
 
-                var isZeroLength = !newTime.compare(newEndTime);
+                let isZeroLength = !newTime.compare(newEndTime);
                 if ((isZeroLength &&
                      newTime.compare(rangeStart) >= 0 &&
                      newTime.compare(rangeEnd) < 0) ||
                     (!isZeroLength &&
                      newTime.compare(rangeEnd) < 0 &&
                      newEndTime.compare(rangeStart) > 0)) {
                     // Current range of event conflicts with another event.
                     // we need to find a new time for this event. A trivial approach
@@ -1009,112 +1009,112 @@
       <field name="mZoomFactor">100</field>
 
       <property name="zoomFactor">
         <getter><![CDATA[
           return this.mZoomFactor;
         ]]></getter>
         <setter><![CDATA[
           this.mZoomFactor = val;
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
-              var freebusy = this.getFreeBusyElement(i);
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
+              let freebusy = this.getFreeBusyElement(i);
               freebusy.zoomFactor = this.mZoomFactor;
           }
           this.forceRefresh();
           return val;
         ]]></setter>
       </property>
 
       <property name="force24Hours">
         <getter><![CDATA[
           return this.mForce24Hours;
         ]]></getter>
         <setter><![CDATA[
           this.mForce24Hours = val;
           this.initTimeRange();
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
-              var freebusy = this.getFreeBusyElement(i);
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
+              let freebusy = this.getFreeBusyElement(i);
               freebusy.force24Hours = this.mForce24Hours;
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="firstVisibleRow">
         <getter><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           return listbox.getIndexOfFirstVisibleRow();
         ]]></getter>
         <setter><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           listbox.scrollToIndex(val);
           return val;
         ]]></setter>
       </property>
 
       <property name="ratio">
         <setter><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var rowcount = listbox.getRowCount();
+          let rowcount = listbox.getRowCount();
           listbox.scrollToIndex(Math.floor(rowcount * val));
           return val;
         ]]></setter>
       </property>
 
       <constructor><![CDATA[
         Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-        var args = window.arguments[0];
+        let args = window.arguments[0];
 
         this.initTimeRange();
 
         this.mRange = Number(this.getAttribute("range"));
 
         this.mMaxFreeBusy = 0;
         this.mPendingRequests = [];
 
-        var self = this;
-        var load = function freebusy_grid_loadHandler() {
+        let self = this;
+        let load = function freebusy_grid_loadHandler() {
             self.onLoad();
         };
         window.addEventListener("load", load, true);
-        var unload = function freebusy_grid_unloadHandler() {
+        let unload = function freebusy_grid_unloadHandler() {
             self.onUnload();
         };
         window.addEventListener("unload", unload, true);
       ]]></constructor>
 
       <property name="startDate">
         <getter><![CDATA[
           return this.mStartDate;
         ]]></getter>
         <setter><![CDATA[
           this.mStartDate = val.clone();
           this.mStartDate.makeImmutable();
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
               this.getFreeBusyElement(i).startDate = val;
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="endDate">
         <getter><![CDATA[
           return this.mEndDate;
         ]]></getter>
         <setter><![CDATA[
           this.mEndDate = val.clone();
           this.mEndDate.makeImmutable();
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
               this.getFreeBusyElement(i).endDate = val;
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="documentSize">
         <getter><![CDATA[
@@ -1126,39 +1126,39 @@
         <body><![CDATA[
           this.onInitialize();
         ]]></body>
       </method>
 
       <method name="onUnload">
         <body><![CDATA[
           // Cancel pending free/busy requests
-          for (var request of this.mPendingRequests) {
+          for (let request of this.mPendingRequests) {
               request.cancel(null);
           }
 
           this.mPendingRequests = [];
         ]]></body>
       </method>
 
       <method name="onInitialize">
         <body><![CDATA[
-          var args = window.arguments[0];
-          var startTime = args.startTime;
-          var endTime = args.endTime;
-          var calendar = args.calendar;
+          let args = window.arguments[0];
+          let startTime = args.startTime;
+          let endTime = args.endTime;
+          let calendar = args.calendar;
 
-          var kDefaultTimezone = calendarDefaultTimezone();
+          let kDefaultTimezone = calendarDefaultTimezone();
           this.startDate = startTime.getInTimezone(kDefaultTimezone);
           this.endDate = endTime.getInTimezone(kDefaultTimezone);
 
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var template =
+          let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "item");
           this.appendNewRow(listbox, template, null);
           template.remove();
 
           this.updateFreeBusy();
         ]]></body>
       </method>
@@ -1171,27 +1171,27 @@
 
       <!-- appends a new empty row -->
       <method name="appendNewRow">
         <parameter name="aParentNode"/>
         <parameter name="aTemplateNode"/>
         <parameter name="aReplaceNode"/>
         <body><![CDATA[
           this.mMaxFreeBusy++;
-          var newNode = aTemplateNode.cloneNode(true);
+          let newNode = aTemplateNode.cloneNode(true);
           if (aReplaceNode) {
               aParentNode.replaceChild(newNode, aReplaceNode);
           } else {
               aParentNode.appendChild(newNode);
           }
 
-          var grid =
+          let grid =
               document.getAnonymousElementByAttribute(
                   newNode, "anonid", "grid");
-          var rowNumber = this.mMaxFreeBusy;
+          let rowNumber = this.mMaxFreeBusy;
           if (rowNumber >= 0) {
               grid.setAttribute("id", "attendeeCol4#" + rowNumber);
           }
 
           // Propagate start/enddate to the new row.
           grid.startDate = this.mStartDate;
           grid.endDate = this.mEndDate;
 
@@ -1210,51 +1210,51 @@
               grid.removeAttribute('focused');
           }
         ]]></body>
       </method>
 
       <property name="scroll">
         <setter><![CDATA[
           this.mScrollOffset = val;
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
               this.getFreeBusyElement(i).scroll = val;
           }
           return val;
         ]]></setter>
       </property>
 
       <method name="onModify">
         <parameter name="event"/>
         <body><![CDATA[
           // Add or remove rows depending on the number of items
           // contained in the list passed as argument.
-          var list = event.details;
+          let list = event.details;
           if (this.mMaxFreeBusy != list.length) {
-              var listbox =
+              let listbox =
                   document.getAnonymousElementByAttribute(
                       this, "anonid", "listbox");
-              var template =
+              let template =
                   document.getAnonymousElementByAttribute(
                       this, "anonid", "item");
               while (this.mMaxFreeBusy < list.length) {
-                  var nextDummy = this.getNextDummyRow();
+                  let nextDummy = this.getNextDummyRow();
                   this.appendNewRow(listbox, template, nextDummy);
                   template =
                       document.getAnonymousElementByAttribute(
                           this, "anonid", "item");
               }
               while (this.mMaxFreeBusy > list.length) {
                   this.deleteRow(this.mMaxFreeBusy);
               }
           }
 
           // Store the attributes in our grid rows.
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
-              var freebusy = this.getFreeBusyElement(i);
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
+              let freebusy = this.getFreeBusyElement(i);
               freebusy.setAttribute("calid", list[i - 1].calid);
               freebusy.removeAttribute("dirty");
               if (list[i - 1].dirty) {
                   freebusy.setAttribute("dirty", "true");
               }
           }
 
           // Align all rows
@@ -1262,36 +1262,36 @@
 
           this.updateFreeBusy();
         ]]></body>
       </method>
 
       <!-- updateFreeBusy(), implementation of the core functionality of this binding -->
       <method name="updateFreeBusy">
         <body><![CDATA[
-          var fbService = getFreeBusyService();
-          for (var i = 1; i <= this.mMaxFreeBusy; i++) {
+          let fbService = getFreeBusyService();
+          for (let i = 1; i <= this.mMaxFreeBusy; i++) {
               // Retrieve the string from the appropriate row
-              var freebusy = this.getFreeBusyElement(i);
+              let freebusy = this.getFreeBusyElement(i);
               if (freebusy.hasAttribute("dirty")) {
                   freebusy.removeAttribute("dirty");
-                  var calid = freebusy.getAttribute("calid");
+                  let calid = freebusy.getAttribute("calid");
                   if (calid && calid.length > 0) {
                       // Define the datetime range we would like to ask for.
-                      var start = this.mStartDate.clone();
+                      let start = this.mStartDate.clone();
                       start.hour = 0;
                       start.minute = 0;
                       start.second = 0;
-                      var end = start.clone();
+                      let end = start.clone();
                       end.day += this.mRange;
                       // Update with 'no data available' until response will be received
                       freebusy.onFreeBusy(null);
                       try {
-                          var listener = new calFreeBusyListener(freebusy, this);
-                          var request = fbService.getFreeBusyIntervals(calid,
+                          let listener = new calFreeBusyListener(freebusy, this);
+                          let request = fbService.getFreeBusyIntervals(calid,
                                                                        start,
                                                                        end,
                                                                        Components.interfaces.calIFreeBusyInterval.BUSY_ALL,
                                                                        listener);
                           if (request && request.isPending) {
                               this.mPendingRequests.push(request);
                           }
                       } catch (ex) {
@@ -1300,30 +1300,30 @@
                   }
               }
           }
         ]]></body>
       </method>
 
       <method name="nextSlot">
         <body><![CDATA[
-          var startTime = this.mStartDate.clone();
-          var endTime = this.mEndDate.clone();
+          let startTime = this.mStartDate.clone();
+          let endTime = this.mEndDate.clone();
 
           startTime.isDate = false;
           endTime.isDate = false;
 
-          var allDay = this.mStartDate.isDate;
-          var step_in_minutes = Math.floor(60 * this.zoomFactor / 100);
+          let allDay = this.mStartDate.isDate;
+          let step_in_minutes = Math.floor(60 * this.zoomFactor / 100);
           if (allDay) {
               step_in_minutes = 60 * 24;
               endTime.day++;
           }
 
-          var duration = endTime.subtractDate(startTime);
+          let duration = endTime.subtractDate(startTime);
 
           startTime.minute += step_in_minutes;
 
           if (startTime.hour < this.mStartHour) {
               startTime.hour = this.mStartHour;
               startTime.minute = 0;
           }
 
@@ -1339,22 +1339,22 @@
                   return this.mStartDate.clone();
               }
           }
 
           // 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;
+          let recheck;
           do {
               recheck = false;
 
               for (let i = 1; i <= this.mMaxFreeBusy; i++) {
-                  var row = this.getFreeBusyElement(i);
+                  let row = this.getFreeBusyElement(i);
                   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;
@@ -1408,33 +1408,33 @@
 
           // Return the new starttime of the item.
           return startTime;
         ]]></body>
       </method>
 
       <method name="forceRefresh">
         <body><![CDATA[
-          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();
         ]]></body>
       </method>
 
       <!-- This method returns the <xul:listitem> at row numer 'aRow' -->
       <method name="getListItem">
         <parameter name="aRow"/>
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           if (listbox && aRow > 0) {
-              var listitems = listbox.getElementsByTagNameNS('*', 'listitem');
+              let listitems = listbox.getElementsByTagNameNS('*', 'listitem');
               if (listitems && listitems.length >= aRow) {
                   return listitems[aRow - 1];
               }
           }
           return 0;
         ]]></body>
       </method>
 
@@ -1445,100 +1445,100 @@
                                                          "attendeeCol4#" + aRow);
         ]]></body>
       </method>
 
       <method name="deleteRow">
         <parameter name="aRow"/>
         <body><![CDATA[
           // Reset id's in order to not break the sequence
-          var max = this.mMaxFreeBusy;
+          let max = this.mMaxFreeBusy;
           this.removeRow(aRow);
-          var numberOfCols = this.numColumns;
-          for (var row = aRow + 1; row <= max; row++) {
-              for (var col = 1; col <= numberOfCols; col++) {
-                  var colID = "attendeeCol" + col + "#" + row;
-                  var elem = document.getAnonymousElementByAttribute(this, "id", colID);
+          let numberOfCols = this.numColumns;
+          for (let row = aRow + 1; row <= max; row++) {
+              for (let col = 1; col <= numberOfCols; col++) {
+                  let colID = "attendeeCol" + col + "#" + row;
+                  let elem = document.getAnonymousElementByAttribute(this, "id", colID);
                   if (elem) {
                       elem.setAttribute(
                           "id",
                           "attendeeCol" + (col) + "#" + (row - 1));
                   }
               }
           }
         ]]></body>
       </method>
 
       <method name="removeRow">
         <parameter name="aRow"/>
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
           this.getListItem(aRow).remove();
           this.fitDummyRows();
           this.mMaxFreeBusy--;
         ]]></body>
       </method>
 
       <!-- gets the next row from the top down -->
       <method name="getNextDummyRow">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var kids = listbox.childNodes;
-          for (var i = 0; i < kids.length; ++i) {
+          let kids = listbox.childNodes;
+          for (let i = 0; i < kids.length; ++i) {
               if (kids[i].hasAttribute("_isDummyRow")) {
                   return kids[i];
               }
           }
           return null;
         ]]></body>
       </method>
 
       <method name="fitDummyRows">
         <body><![CDATA[
-          var self = this;
-          var func = function func() {
+          let self = this;
+          let func = function func() {
               self.calcContentHeight();
               self.createOrRemoveDummyRows();
           };
           setTimeout(func, 0);
         ]]></body>
       </method>
 
       <method name="calcContentHeight">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var items = listbox.getElementsByTagNameNS('*', 'listitem');
+          let items = listbox.getElementsByTagNameNS('*', 'listitem');
           this.mContentHeight = 0;
           if (items.length > 0) {
-              var i = 0;
+              let i = 0;
               do {
                   this.mRowHeight = items[i].boxObject.height;
                   ++i;
               } while (i < items.length && !this.mRowHeight);
               this.mContentHeight = this.mRowHeight * items.length;
           }
         ]]></body>
       </method>
 
       <method name="createOrRemoveDummyRows">
         <body><![CDATA[
-          var listbox =
+          let listbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "listbox");
-          var listboxHeight = listbox.boxObject.height;
+          let listboxHeight = listbox.boxObject.height;
 
           // Remove rows to remove scrollbar
-          var kids = listbox.childNodes;
-          for (var i = kids.length - 1; this.mContentHeight > listboxHeight && i >= 0; --i) {
+          let kids = listbox.childNodes;
+          for (let i = kids.length - 1; this.mContentHeight > listboxHeight && i >= 0; --i) {
               if (kids[i].hasAttribute("_isDummyRow")) {
                   this.mContentHeight -= this.mRowHeight;
                   kids[i].remove();
               }
           }
 
           // Add rows to fill space
           if (this.mRowHeight) {
@@ -1548,48 +1548,48 @@
               }
           }
         ]]></body>
       </method>
 
       <method name="createDummyCell">
         <parameter name="aParent"/>
         <body><![CDATA[
-          var cell = document.createElement("listcell");
+          let cell = document.createElement("listcell");
           cell.setAttribute("class", "addressingWidgetCell dummy-row-cell");
           if (aParent) {
               aParent.appendChild(cell);
           }
           return cell;
         ]]></body>
       </method>
 
       <method name="createDummyItem">
         <parameter name="aParent"/>
         <body><![CDATA[
-          var titem = document.createElement("listitem");
+          let titem = document.createElement("listitem");
           titem.setAttribute("_isDummyRow", "true");
           titem.setAttribute("class", "dummy-row");
-          for (var i = this.numColumns; i > 0; i--) {
+          for (let i = this.numColumns; i > 0; i--) {
               this.createDummyCell(titem);
           }
           if (aParent) {
               aParent.appendChild(titem);
           }
           return titem;
         ]]></body>
       </method>
 
       <property name="numColumns">
         <getter><![CDATA[
           if (!this.mNumColumns) {
-              var listbox =
+              let listbox =
                   document.getAnonymousElementByAttribute(
                       this, "anonid", "listbox");
-              var listCols = listbox.getElementsByTagNameNS('*', 'listcol');
+              let listCols = listbox.getElementsByTagNameNS('*', 'listcol');
               this.mNumColumns = listCols.length || 1;
           }
           return this.mNumColumns;
         ]]></getter>
       </property>
 
       <method name="initTimeRange">
         <body><![CDATA[
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
@@ -32,17 +32,17 @@
 
     <implementation>
 
       <field name="mRecurrenceInfo">null</field>
       <field name="mResizeHandler">null</field>
       <field name="mDateTime">null</field>
 
       <constructor><![CDATA[
-        var self = this;
+        let self = this;
         this.mResizeHandler = function recurrence_preview_resizeHandler() {
             self.onResize();
         };
         window.addEventListener("resize", this.mResizeHandler, true);
       ]]></constructor>
 
       <destructor><![CDATA[
         window.removeEventListener("resize", this.mResizeHandler, true);
@@ -57,56 +57,56 @@
             if (this.mDateTime == null) {
                 this.mDateTime = now();
             }
             return this.mDateTime;
         ]]></getter>
       </property>
       <method name="onResize">
         <body><![CDATA[
-          var mainbox =
+          let mainbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "mainbox");
-          var minimonth =
+          let minimonth =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "minimonth");
 
-          var row =
+          let row =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "row");
-          var rows = row.parentNode;
+          let rows = row.parentNode;
 
-          var contentWidth = minimonth.boxObject.width;
-          var containerWidth =
+          let contentWidth = minimonth.boxObject.width;
+          let containerWidth =
               document.getAnonymousNodes(this)[0]
                   .boxObject.width;
 
           // Now find out how much elements can be displayed.
           // this is a simple division which always yields a positive integer value.
-          var numHorizontal =
+          let numHorizontal =
               (containerWidth -
                   (containerWidth % contentWidth)) /
                       contentWidth;
 
-          var contentHeight = minimonth.boxObject.height;
-          var containerHeight =
+          let contentHeight = minimonth.boxObject.height;
+          let containerHeight =
               document.getAnonymousNodes(this)[0]
                   .boxObject.height;
 
           // Now find out how much elements can be displayed.
           // this is a simple division which always yields a positive integer value.
-          var numVertical =
+          let numVertical =
               (containerHeight -
                   (containerHeight % contentHeight)) /
                       contentHeight;
           numVertical = Math.max(1, numVertical);
 
           // Count the number of existing rows
-          var numRows = 0;
-          var rowIterator = row;
+          let numRows = 0;
+          let rowIterator = row;
           while (rowIterator) {
               numRows++;
               rowIterator = rowIterator.nextSibling;
           }
 
           // Adjust rows
           while (numRows < numVertical) {
               let newNode = row.cloneNode(true);
@@ -114,33 +114,33 @@
               numRows++;
           }
           while (numRows > numVertical) {
               rows.firstChild.remove();
               numRows--;
           }
 
           // Adjust columns in the grid
-          var column =
+          let column =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "column");
-          var columns = column.parentNode;
+          let columns = column.parentNode;
           while ((columns.childNodes.length - 1) < numHorizontal) {
-              var newColumn = column.cloneNode(false);
+              let newColumn = column.cloneNode(false);
               columns.insertBefore(newColumn, column.nextSibling);
           }
           while ((columns.childNodes.length - 1) > numHorizontal) {
               columns.firstChild.remove();
           }
 
           // Walk all rows and adjust column elements
           row = document.getAnonymousElementByAttribute(
                    this, "anonid", "row");
           while (row) {
-              var firstChild = row.firstChild;
+              let firstChild = row.firstChild;
               while ((row.childNodes.length - 1) < numHorizontal) {
                   let newNode = firstChild.cloneNode(true);
                   firstChild.parentNode.insertBefore(newNode, firstChild);
               }
               while ((row.childNodes.length - 1) > numHorizontal) {
                   row.firstChild.remove();
               }
               row = row.nextSibling;
@@ -148,74 +148,74 @@
 
           this.updateContent();
           this.updatePreview(this.mRecurrenceInfo);
         ]]></body>
       </method>
 
       <method name="updateContent">
         <body><![CDATA[
-          var dt = cal.dateTimeToJsDate(this.dateTime);
-          var row = document.getAnonymousElementByAttribute(
+          let dt = cal.dateTimeToJsDate(this.dateTime);
+          let row = document.getAnonymousElementByAttribute(
                         this, "anonid", "row");
           while (row) {
-              var numChilds = row.childNodes.length - 1;
-              for (var i = 0; i < numChilds; i++) {
-                  var minimonth = row.childNodes[i];
+              let numChilds = row.childNodes.length - 1;
+              for (let i = 0; i < numChilds; i++) {
+                  let minimonth = row.childNodes[i];
                   minimonth.showMonth(dt);
                   dt.setMonth(dt.getMonth() + 1);
               }
               row = row.nextSibling;
           }
         ]]></body>
       </method>
 
       <method name="updatePreview">
         <parameter name="aRecurrenceInfo"/>
         <body><![CDATA[
           this.mRecurrenceInfo = aRecurrenceInfo;
-          var start = this.dateTime.clone();
+          let start = this.dateTime.clone();
           start.day = 1;
           start.hour = 0;
           start.minute = 0;
           start.second = 0;
-          var end = start.clone();
+          let 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");
+          let 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++) {
+              let numChilds = row.childNodes.length - 1;
+              for (let 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];
+                  let 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, {});
+                      let 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;
+                      let index = 0;
+                      let occurrence = null;
                       if (index < dates.length) {
                           occurrence =
                               dates[index++]
                                   .getInTimezone(start.timezone);
                       }
-                      var current = start.clone();
+                      let current = start.clone();
                       while (current.compare(end) < 0) {
                         let box = minimonth.getBoxForDate(current);
                         if (box) {
                             if (occurrence &&
                                 occurrence.day == current.day &&
                                 occurrence.month == current.month &&
                                 occurrence.year == current.year) {
                                 box.setAttribute("busy", 1);
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -13,43 +13,43 @@ var gUntilDate = null;
 
 /**
  * Sets up the recurrence dialog from the window arguments. Takes care of filling
  * the dialog controls with the recurrence information for this window.
  */
 function onLoad() {
     changeWidgetsOrder();
 
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
-    var calendar = item.calendar;
-    var recinfo = args.recurrenceInfo;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
+    let calendar = item.calendar;
+    let recinfo = args.recurrenceInfo;
 
     gStartTime = args.startTime;
     gEndTime = args.endTime;
-    var preview = document.getElementById("recurrence-preview");
+    let preview = document.getElementById("recurrence-preview");
     preview.dateTime = gStartTime.getInTimezone(calendarDefaultTimezone());
 
     onChangeCalendar(calendar);
 
     // Set starting value for 'repeat until' rule and highlight the start date.
     let repeatDate = cal.dateTimeToJsDate(gStartTime.getInTimezone(cal.floating()));
     setElementValue("repeat-until-date", repeatDate);
     document.getElementById("repeat-until-date").extraDate = repeatDate;
 
     if (item.parentItem != item) {
         item = item.parentItem;
     }
-    var rule = null;
+    let rule = null;
     if (recinfo) {
         // Split out rules and exceptions
         try {
-            var rrules = splitRecurrenceRules(recinfo);
-            var rules = rrules[0];
-            var exceptions = rrules[1];
+            let rrules = splitRecurrenceRules(recinfo);
+            let rules = rrules[0];
+            let exceptions = rrules[1];
             // Deal with the rules
             if (rules.length > 0) {
                 // We only handle 1 rule currently
                 rule = cal.wrapInstance(rules[0], Components.interfaces.calIRecurrenceRule);
             }
         } catch (ex) {
             Components.utils.reportError(ex);
         }
@@ -123,21 +123,21 @@ function initializeControls(rule) {
             document.getElementById("period-list").selectedIndex = 3;
             break;
         default:
             document.getElementById("period-list").selectedIndex = 0;
             dump("unable to handle your rule type!\n");
             break;
     }
 
-    var byDayRuleComponent = rule.getComponent("BYDAY", {});
-    var byMonthDayRuleComponent = rule.getComponent("BYMONTHDAY", {});
-    var byMonthRuleComponent = rule.getComponent("BYMONTH", {});
-    var kDefaultTimezone = calendarDefaultTimezone();
-    var startDate = gStartTime.getInTimezone(kDefaultTimezone);
+    let byDayRuleComponent = rule.getComponent("BYDAY", {});
+    let byMonthDayRuleComponent = rule.getComponent("BYMONTHDAY", {});
+    let byMonthRuleComponent = rule.getComponent("BYMONTH", {});
+    let kDefaultTimezone = calendarDefaultTimezone();
+    let startDate = gStartTime.getInTimezone(kDefaultTimezone);
 
     // "DAILY" ruletype
     // byDayRuleComponents may have been set priorily by "MONTHLY"- ruletypes
     // where they have a different context-
     // that's why we also query the current rule-type
     if (byDayRuleComponent.length == 0 || rule.type != "DAILY") {
         document.getElementById("daily-group").selectedIndex = 0;
     } else {
@@ -147,34 +147,34 @@ function initializeControls(rule) {
     // "WEEKLY" ruletype
     if (byDayRuleComponent.length == 0 || rule.type != "WEEKLY") {
         document.getElementById("daypicker-weekday").days = [startDate.weekday + 1];
     } else {
         document.getElementById("daypicker-weekday").days = byDayRuleComponent;
     }
 
     // "MONTHLY" ruletype
-    var ruleComponentsEmpty = (byDayRuleComponent.length == 0 &&
+    let ruleComponentsEmpty = (byDayRuleComponent.length == 0 &&
                                byMonthDayRuleComponent.length == 0);
     if (ruleComponentsEmpty || rule.type != "MONTHLY") {
         document.getElementById("monthly-group").selectedIndex = 1;
         document.getElementById("monthly-days").days = [startDate.day];
-        var day = Math.floor((startDate.day - 1) / 7) + 1;
+        let day = Math.floor((startDate.day - 1) / 7) + 1;
         setElementValue("monthly-ordinal", day);
         setElementValue("monthly-weekday", startDate.weekday + 1);
     } else {
         if (everyWeekDay(byDayRuleComponent)) {
             // Every day of the month.
             document.getElementById("monthly-group").selectedIndex = 0;
             setElementValue("monthly-ordinal", 0);
             setElementValue("monthly-weekday", -1);
         } else if (byDayRuleComponent.length > 0) {
             // One of the first five days or weekdays of the month.
             document.getElementById("monthly-group").selectedIndex = 0;
-            var ruleInfo = getOrdinalAndWeekdayOfRule(byDayRuleComponent[0]);
+            let ruleInfo = getOrdinalAndWeekdayOfRule(byDayRuleComponent[0]);
             setElementValue("monthly-ordinal", ruleInfo.ordinal);
             setElementValue("monthly-weekday", ruleInfo.weekday);
         } else if (byMonthDayRuleComponent.length == 1 && byMonthDayRuleComponent[0] == -1) {
             // The last day of the month.
             document.getElementById("monthly-group").selectedIndex = 0;
             setElementValue("monthly-ordinal", byMonthDayRuleComponent[0]);
             setElementValue("monthly-weekday", byMonthDayRuleComponent[0]);
         } else if (byMonthDayRuleComponent.length > 0) {
@@ -260,32 +260,32 @@ function onSave(item) {
 
     // This works, but if we ever support more complex recurrence,
     // e.g. recurrence for Martians, then we're going to want to
     // not clone and just recreate the recurrenceInfo each time.
     // The reason is that the order of items (rules/dates/datesets)
     // matters, so we can't always just append at the end.  This
     // code here always inserts a rule first, because all our
     // exceptions should come afterward.
-    var deckNumber = Number(getElementValue("period-list"));
+    let deckNumber = Number(getElementValue("period-list"));
 
-    var args = window.arguments[0];
-    var recurrenceInfo = args.recurrenceInfo;
+    let args = window.arguments[0];
+    let recurrenceInfo = args.recurrenceInfo;
     if (recurrenceInfo) {
         recurrenceInfo = recurrenceInfo.clone();
-        var rrules = splitRecurrenceRules(recurrenceInfo);
+        let rrules = splitRecurrenceRules(recurrenceInfo);
         if (rrules[0].length > 0) {
             recurrenceInfo.deleteRecurrenceItem(rrules[0][0]);
         }
         recurrenceInfo.item = item;
     } else {
         recurrenceInfo = createRecurrenceInfo(item);
     }
 
-    var recRule = createRecurrenceRule();
+    let 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";
         let dailyGroup = document.getElementById("daily-group");
         if (dailyGroup.selectedIndex == 0) {
             let ndays = Math.max(1, Number(getElementValue("daily-days")));
             recRule.interval = ndays;
@@ -396,18 +396,18 @@ function onSave(item) {
 }
 
 /**
  * Handler function to be called when the accept button is pressed.
  *
  * @return      Returns true if the window should be closed
  */
 function onAccept() {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
     args.onOk(onSave(item));
     // Don't close the dialog if a warning must be showed.
     return !checkUntilDate.warning;
 }
 
 /**
  * Handler function to be called when the Cancel button is pressed.
  *
@@ -424,18 +424,18 @@ function onCancel() {
  * setup).
  *
  * XXX we don't change the calendar in this dialog, this function should be
  * consolidated or renamed.
  *
  * @param calendar    The calendar to use for setup.
  */
 function onChangeCalendar(calendar) {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
 
     // Set 'gIsReadOnly' if the calendar is read-only
     gIsReadOnly = false;
     if (calendar && calendar.readOnly) {
         gIsReadOnly = true;
     }
 
     // Disable or enable controls based on a set or rules
@@ -473,50 +473,50 @@ function disableOrEnable(item) {
 
 /**
  * Disables all fields that have an attribute that matches the argument and is
  * set to "true".
  *
  * @param aAttributeName    The attribute to search for.
  */
 function disableRecurrenceFields(aAttributeName) {
-    var disableElements = document.getElementsByAttribute(aAttributeName, "true");
-    for (var i = 0; i < disableElements.length; i++) {
+    let disableElements = document.getElementsByAttribute(aAttributeName, "true");
+    for (let i = 0; i < disableElements.length; i++) {
         disableElements[i].setAttribute('disabled', 'true');
     }
 }
 
 /**
  * Enables all fields that have an attribute that matches the argument and is
  * set to "true".
  *
  * @param aAttributeName    The attribute to search for.
  */
 function enableRecurrenceFields(aAttributeName) {
-    var enableElements = document.getElementsByAttribute(aAttributeName, "true");
-    for (var i = 0; i < enableElements.length; i++) {
+    let enableElements = document.getElementsByAttribute(aAttributeName, "true");
+    for (let i = 0; i < enableElements.length; i++) {
         enableElements[i].removeAttribute('disabled');
     }
 }
 
 /**
  * Split rules into negative and positive rules.
  *
  * XXX This function is duplicate from calendar-dialog-utils.js, which we may
  * want to include in this dialog.
  *
  * @param recurrenceInfo    An item's recurrence info to parse.
  * @return                  An array with two elements: an array of positive
  *                            rules and an array of negative rules.
  */
 function splitRecurrenceRules(recurrenceInfo) {
-    var ritems = recurrenceInfo.getRecurrenceItems({});
-    var rules = [];
-    var exceptions = [];
-    for (var r of ritems) {
+    let ritems = recurrenceInfo.getRecurrenceItems({});
+    let rules = [];
+    let exceptions = [];
+    for (let r of ritems) {
         if (r.isNegative) {
             exceptions.push(r);
         } else {
             rules.push(r);
         }
     }
     return [rules, exceptions];
 }
@@ -531,43 +531,43 @@ function updateRecurrenceDeck() {
     updateRecurrenceControls();
 }
 
 /**
  * Updates the controls regarding ranged controls (i.e repeat forever, repeat
  * until, repeat n times...)
  */
 function updateRecurrenceRange() {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
     if (item.parentItem != item || gIsReadOnly) {
         return;
     }
 
-    var radioRangeForever =
+    let radioRangeForever =
         document.getElementById("recurrence-range-forever");
-    var radioRangeFor =
+    let radioRangeFor =
         document.getElementById("recurrence-range-for");
-    var radioRangeUntil =
+    let radioRangeUntil =
         document.getElementById("recurrence-range-until");
-    var rangeTimesCount =
+    let rangeTimesCount =
         document.getElementById("repeat-ntimes-count");
-    var rangeUntilDate =
+    let rangeUntilDate =
         document.getElementById("repeat-until-date");
-    var rangeAppointmentsLabel =
+    let rangeAppointmentsLabel =
         document.getElementById("repeat-appointments-label");
 
-    var deckNumber = Number(getElementValue("period-list"));
+    let deckNumber = Number(getElementValue("period-list"));
 
     radioRangeForever.removeAttribute("disabled");
     radioRangeFor.removeAttribute("disabled");
     radioRangeUntil.removeAttribute("disabled");
     rangeAppointmentsLabel.removeAttribute("disabled");
 
-    var durationSelection = document.getElementById("recurrence-duration")
+    let durationSelection = document.getElementById("recurrence-duration")
                                     .selectedItem.value;
 
     if (durationSelection == "ntimes") {
         rangeTimesCount.removeAttribute("disabled");
     } else {
         rangeTimesCount.setAttribute("disabled", "true");
     }
 
@@ -577,55 +577,55 @@ function updateRecurrenceRange() {
         rangeUntilDate.setAttribute("disabled", "true");
     }
 }
 
 /**
  * Updates the recurrence preview calendars using the window's item.
  */
 function updatePreview() {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
     if (item.parentItem != item) {
         item = item.parentItem;
     }
 
     // TODO: We should better start the whole dialog with a newly cloned item
     // and always pump changes immediately into it. This would eliminate the
     // need to break the encapsulation, as we do it here. But we need the item
     // to contain the startdate in order to calculate the recurrence preview.
     item = item.clone();
-    var kDefaultTimezone = calendarDefaultTimezone();
+    let kDefaultTimezone = calendarDefaultTimezone();
     if (isEvent(item)) {
-        var startDate = gStartTime.getInTimezone(kDefaultTimezone);
-        var endDate = gEndTime.getInTimezone(kDefaultTimezone);
+        let startDate = gStartTime.getInTimezone(kDefaultTimezone);
+        let endDate = gEndTime.getInTimezone(kDefaultTimezone);
         if (startDate.isDate) {
             endDate.day--;
         }
 
         item.startDate = startDate;
         item.endDate = endDate;
     }
     if (isToDo(item)) {
-        var entryDate = gStartTime;
+        let entryDate = gStartTime;
         if (entryDate) {
             entryDate = entryDate.getInTimezone(kDefaultTimezone);
         } else {
             item.recurrenceInfo = null;
         }
         item.entryDate = entryDate;
-        var dueDate = gEndTime;
+        let dueDate = gEndTime;
         if (dueDate) {
             dueDate = dueDate.getInTimezone(kDefaultTimezone);
         }
         item.dueDate = dueDate;
     }
 
-    var recInfo = onSave(item);
-    var preview = document.getElementById("recurrence-preview");
+    let recInfo = onSave(item);
+    let preview = document.getElementById("recurrence-preview");
     preview.updatePreview(recInfo);
 }
 
 /**
  * Checks the until date just entered in the datepicker in order to avoid
  * setting a date earlier than the start date.
  * Restores the previous correct date, shows a warning and prevents to close the
  * dialog when the user enters a wrong until date.
@@ -664,61 +664,61 @@ function updateRecurrenceControls() {
 }
 
 /**
  * Disables/enables controls related to the recurrence pattern.
  * the status of the controls depends on which period entry is selected
  * and which form of pattern rule is selected.
  */
 function updateRecurrencePattern() {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
     if (item.parentItem != item || gIsReadOnly) {
         return;
     }
 
     switch (Number(getElementValue("period-list"))) {
         // daily
         case 0:
-            var dailyGroup = document.getElementById("daily-group");
-            var dailyDays = document.getElementById("daily-days");
+            let dailyGroup = document.getElementById("daily-group");
+            let dailyDays = document.getElementById("daily-days");
             dailyDays.removeAttribute("disabled");
             if (dailyGroup.selectedIndex == 1) {
                 dailyDays.setAttribute("disabled", "true");
             }
             break;
         // weekly
         case 1:
             break;
         // monthly
         case 2:
-            var monthlyGroup = document.getElementById("monthly-group");
-            var monthlyOrdinal = document.getElementById("monthly-ordinal");
-            var monthlyWeekday = document.getElementById("monthly-weekday");
-            var monthlyDays = document.getElementById("monthly-days");
+            let monthlyGroup = document.getElementById("monthly-group");
+            let monthlyOrdinal = document.getElementById("monthly-ordinal");
+            let monthlyWeekday = document.getElementById("monthly-weekday");
+            let monthlyDays = document.getElementById("monthly-days");
             monthlyOrdinal.removeAttribute("disabled");
             monthlyWeekday.removeAttribute("disabled");
             monthlyDays.removeAttribute("disabled");
             if (monthlyGroup.selectedIndex == 0) {
                 monthlyDays.setAttribute("disabled", "true");
             } else {
                 monthlyOrdinal.setAttribute("disabled", "true");
                 monthlyWeekday.setAttribute("disabled", "true");
             }
             break;
         // yearly
         case 3:
-            var yearlyGroup = document.getElementById("yearly-group");
-            var yearlyDays = document.getElementById("yearly-days");
-            var yearlyMonthOrdinal = document.getElementById("yearly-month-ordinal");
-            var yearlyPeriodOfMonthLabel = document.getElementById("yearly-period-of-month-label");
-            var yearlyOrdinal = document.getElementById("yearly-ordinal");
-            var yearlyWeekday = document.getElementById("yearly-weekday");
-            var yearlyMonthRule = document.getElementById("yearly-month-rule");
-            var yearlyPeriodOfLabel = document.getElementById("yearly-period-of-label");
+            let yearlyGroup = document.getElementById("yearly-group");
+            let yearlyDays = document.getElementById("yearly-days");
+            let yearlyMonthOrdinal = document.getElementById("yearly-month-ordinal");
+            let yearlyPeriodOfMonthLabel = document.getElementById("yearly-period-of-month-label");
+            let yearlyOrdinal = document.getElementById("yearly-ordinal");
+            let yearlyWeekday = document.getElementById("yearly-weekday");
+            let yearlyMonthRule = document.getElementById("yearly-month-rule");
+            let yearlyPeriodOfLabel = document.getElementById("yearly-period-of-label");
             yearlyDays.removeAttribute("disabled");
             yearlyMonthOrdinal.removeAttribute("disabled");
             yearlyOrdinal.removeAttribute("disabled");
             yearlyWeekday.removeAttribute("disabled");
             yearlyMonthRule.removeAttribute("disabled");
             yearlyPeriodOfLabel.removeAttribute("disabled");
             yearlyPeriodOfMonthLabel.removeAttribute("disabled");
             if (yearlyGroup.selectedIndex == 0) {
@@ -740,42 +740,42 @@ function updateRecurrencePattern() {
  * This is needed for some locales that expect a different wording order.
  *
  * @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 = {};
+    let localeOrder;
+    let parents = {};
 
-    for (var key in aPropParams) {
+    for (let 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 {
         localeOrder = calGetString("calendar-event-dialog",
                                    aPropKey,
                                    aPropParams);
 
         localeOrder = localeOrder.split(" ");
     } catch (ex) {
-        var s = "The key " + aPropKey + " in calendar-event-dialog.prop" +
+        let 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 (let i = 0; i < aPropParams.length; i++) {
-        var newEl = document.getElementById(localeOrder[i]);
+        let 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-timezone.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
@@ -4,17 +4,17 @@
 
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
 
 /**
  * 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];
+    let args = window.arguments[0];
     window.time = args.time;
     window.onAcceptCallback = args.onOk;
 
     let tzProvider = (args.calendar.getProperty("timezones.provider") ||
                       cal.getTimezoneService());
     window.tzProvider = tzProvider;
 
     let menulist = document.getElementById("timezone-menulist");
@@ -64,21 +64,21 @@ function onLoad() {
 
 /**
  * Find the index of the timezone menuitem corresponding to the given timezone.
  *
  * @param timezone      The calITimezone to look for.
  * @return              The index of the childnode below "timezone-menulist"
  */
 function findTimezone(timezone) {
-    var tzid = timezone.tzid;
-    var menulist = document.getElementById("timezone-menulist");
-    var numChilds = menulist.childNodes[0].childNodes.length;
-    for (var i = 0; i < numChilds; i++) {
-        var menuitem = menulist.childNodes[0].childNodes[i];
+    let tzid = timezone.tzid;
+    let menulist = document.getElementById("timezone-menulist");
+    let numChilds = menulist.childNodes[0].childNodes.length;
+    for (let i = 0; i < numChilds; i++) {
+        let menuitem = menulist.childNodes[0].childNodes[i];
         if (menuitem.getAttribute("value") == tzid) {
             return i;
         }
     }
     return -1;
 }
 
 /**
@@ -114,21 +114,21 @@ function updateTimezone() {
     image.setAttribute("tzid", standardTZOffset);
 }
 /**
  * Handler function to be called when the accept button is pressed.
  *
  * @return      Returns true if the window should be closed
  */
 function onAccept() {
-    var menulist = document.getElementById("timezone-menulist");
-    var menuitem = menulist.selectedItem;
-    var timezone = menuitem.getAttribute("value");
-    var tz = window.tzProvider.getTimezone(timezone);
-    var datetime = window.time.getInTimezone(tz);
+    let menulist = document.getElementById("timezone-menulist");
+    let menuitem = menulist.selectedItem;
+    let timezone = menuitem.getAttribute("value");
+    let tz = window.tzProvider.getTimezone(timezone);
+    let datetime = window.time.getInTimezone(tz);
     window.onAcceptCallback(datetime);
     return true;
 }
 
 /**
  * Handler function to be called when the cancel button is pressed.
  *
  */
--- a/calendar/base/content/dialogs/calendar-invitations-dialog.js
+++ b/calendar/base/content/dialogs/calendar-invitations-dialog.js
@@ -6,121 +6,121 @@ Components.utils.import("resource://cale
 Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 /**
  * Sets up the invitations dialog from the window arguments, retrieves the
  * invitations from the invitations manager.
  */
 function onLoad() {
-    var operationListener = {
+    let operationListener = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
         onOperationComplete: function oL_onOperationComplete(aCalendar,
                                                              aStatus,
                                                              aOperationType,
                                                              aId,
                                                              aDetail) {
-            var updatingBox = document.getElementById("updating-box");
+            let updatingBox = document.getElementById("updating-box");
             updatingBox.setAttribute("hidden", "true");
-            var richListBox = document.getElementById("invitations-listbox");
+            let richListBox = document.getElementById("invitations-listbox");
             if (richListBox.getRowCount() > 0) {
                 richListBox.selectedIndex = 0;
             } else {
-                var noInvitationsBox =
+                let noInvitationsBox =
                     document.getElementById("noinvitations-box");
                 noInvitationsBox.removeAttribute("hidden");
             }
         },
         onGetResult: function oL_onGetResult(aCalendar,
                                              aStatus,
                                              aItemType,
                                              aDetail,
                                              aCount,
                                              aItems) {
             if (!Components.isSuccessCode(aStatus)) {
                 return;
             }
             document.title = invitationsText + " (" + aCount + ")";
-            var updatingBox = document.getElementById("updating-box");
+            let updatingBox = document.getElementById("updating-box");
             updatingBox.setAttribute("hidden", "true");
-            var richListBox = document.getElementById("invitations-listbox");
-            for (var item of aItems) {
+            let richListBox = document.getElementById("invitations-listbox");
+            for (let item of aItems) {
                 richListBox.addCalendarItem(item);
             }
         }
     };
 
-    var updatingBox = document.getElementById("updating-box");
+    let updatingBox = document.getElementById("updating-box");
     updatingBox.removeAttribute("hidden");
 
-    var args = window.arguments[0];
+    let args = window.arguments[0];
     args.invitationsManager.getInvitations(operationListener,
                                            args.onLoadOperationListener);
 
     opener.setCursor("auto");
 }
 
 /**
  * Cleans up the invitations dialog, cancels pending requests.
  */
 function onUnload() {
-    var args = window.arguments[0];
+    let args = window.arguments[0];
     args.requestManager.cancelPendingRequests();
 }
 
 /**
  * Handler function to be called when the accept button is pressed.
  *
  * @return      Returns true if the window should be closed
  */
 function onAccept() {
-    var args = window.arguments[0];
+    let args = window.arguments[0];
     fillJobQueue(args.queue);
     args.invitationsManager.processJobQueue(args.queue, args.finishedCallBack);
     return true;
 }
 
 /**
  * Handler function to be called when the cancel button is pressed.
  */
 function onCancel() {
-    var args = window.arguments[0];
+    let args = window.arguments[0];
     if (args.finishedCallBack) {
         args.finishedCallBack();
     }
 }
 
 /**
  * Fills the job queue from the invitations-listbox's items. The job queue
  * contains objects for all items that have a modified participation status.
  *
  * @param queue     The queue to fill.
  */
 function fillJobQueue(queue) {
-    var richListBox = document.getElementById("invitations-listbox");
-    var rowCount = richListBox.getRowCount();
-    for (var i = 0; i < rowCount; i++) {
-        var richListItem = richListBox.getItemAtIndex(i);
-        var newStatus = richListItem.participationStatus;
-        var oldStatus = richListItem.initialParticipationStatus;
+    let richListBox = document.getElementById("invitations-listbox");
+    let rowCount = richListBox.getRowCount();
+    for (let i = 0; i < rowCount; i++) {
+        let richListItem = richListBox.getItemAtIndex(i);
+        let newStatus = richListItem.participationStatus;
+        let oldStatus = richListItem.initialParticipationStatus;
         if (newStatus != oldStatus) {
-            var actionString = "modify";
-            var oldCalendarItem = richListItem.calendarItem;
-            var newCalendarItem = oldCalendarItem.clone();
+            let actionString = "modify";
+            let oldCalendarItem = richListItem.calendarItem;
+            let newCalendarItem = oldCalendarItem.clone();
 
             // set default alarm on unresponded items that have not been declined:
             if (!newCalendarItem.getAlarms({}).length &&
                 (oldStatus == "NEEDS-ACTION") &&
                 (newStatus != "DECLINED")) {
                 cal.alarms.setDefaultValues(newCalendarItem);
             }
 
             richListItem.setCalendarItemParticipationStatus(newCalendarItem,
                 newStatus);
-            var job = {
+            let job = {
                 action: actionString,
                 oldItem: oldCalendarItem,
                 newItem: newCalendarItem
             };
             queue.push(job);
         }
     }
 }
--- a/calendar/base/content/dialogs/calendar-invitations-list.xml
+++ b/calendar/base/content/dialogs/calendar-invitations-list.xml
@@ -14,17 +14,17 @@
   <binding id="calendar-invitations-richlistbox"
            extends="chrome://global/content/bindings/richlistbox.xml#richlistbox"
            xbl:inherits="flex">
     <implementation>
       <!-- methods -->
       <method name="addCalendarItem">
         <parameter name="aItem"/>
         <body><![CDATA[
-          var newNode = createXULElement("calendar-invitations-richlistitem");
+          let newNode = createXULElement("calendar-invitations-richlistitem");
           this.appendChild(newNode);
           newNode.setAttribute("anonid", "invitations-listitem");
           newNode.calendarItem = aItem;
         ]]></body>
       </method>
     </implementation>
   </binding>
 
@@ -102,17 +102,17 @@
       </property>
 
       <property name="participationStatus">
         <getter><![CDATA[
           return this.mParticipationStatus;
         ]]></getter>
         <setter><![CDATA[
           this.mParticipationStatus = val;
-          var icon = document.getAnonymousElementByAttribute(
+          let icon = document.getAnonymousElementByAttribute(
               this, "anonid", "icon");
           icon.setAttribute("status", val);
           return val;
         ]]></setter>
       </property>
 
       <!-- constructor -->
       <constructor><![CDATA[
@@ -124,54 +124,54 @@
       <method name="setCalendarItem">
         <parameter name="aItem"/>
         <body><![CDATA[
             this.mCalendarItem = aItem;
             this.mInitialParticipationStatus =
                 this.getCalendarItemParticipationStatus(aItem);
             this.participationStatus = this.mInitialParticipationStatus;
 
-            var titleLabel = document.getAnonymousElementByAttribute(
+            let titleLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "title");
             titleLabel.setAttribute("value", aItem.title);
 
-            var dateLabel = document.getAnonymousElementByAttribute(
+            let dateLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "date");
-            var dateString = this.mDateFormatter.formatItemInterval(aItem);
+            let dateString = this.mDateFormatter.formatItemInterval(aItem);
             if (aItem.startDate.isDate) {
                 dateString += ", " + this.mStrings.alldayEvent;
             }
             dateLabel.setAttribute("value", dateString);
 
-            var recurrenceLabel = document.getAnonymousElementByAttribute(
+            let recurrenceLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "recurrence");
             if (aItem.recurrenceInfo) {
                 recurrenceLabel.setAttribute("value", this.mStrings.recurrentEvent);
             } else {
                 recurrenceLabel.setAttribute("hidden", "true");
-                var spacer = document.getAnonymousElementByAttribute(
+                let spacer = document.getAnonymousElementByAttribute(
                     this, "anonid", "spacer");
                 spacer.removeAttribute("hidden");
             }
 
-            var locationLabel = document.getAnonymousElementByAttribute(
+            let locationLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "location");
-            var locationString = this.mStrings.location;
-            var locationProperty = aItem.getProperty("LOCATION");
+            let locationString = this.mStrings.location;
+            let locationProperty = aItem.getProperty("LOCATION");
             if (locationProperty && locationProperty.length > 0) {
                 locationString += locationProperty;
             } else {
                 locationString += this.mStrings.none;
             }
             locationLabel.setAttribute("value", locationString);
 
-            var organizerLabel = document.getAnonymousElementByAttribute(
+            let organizerLabel = document.getAnonymousElementByAttribute(
                 this, "anonid", "organizer");
-            var organizerString = this.mStrings.organizer;
-            var org = aItem.organizer;
+            let organizerString = this.mStrings.organizer;
+            let 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);
@@ -202,19 +202,19 @@
       </method>
 
       <method name="setCalendarItemParticipationStatus">
         <parameter name="aItem"/>
         <parameter name="aStatus"/>
         <body><![CDATA[
           let calendar = cal.wrapInstance(aItem.calendar, Components.interfaces.calISchedulingSupport);
           if (calendar) {
-              var att = calendar.getInvitedAttendee(aItem);
+              let att = calendar.getInvitedAttendee(aItem);
               if (att) {
-                  var att_ = att.clone();
+                  let att_ = att.clone();
                   att_.participationStatus = aStatus;
 
                   // Update attendee
                   aItem.removeAttendee(att);
                   aItem.addAttendee(att_);
                   return true;
               }
           }
--- a/calendar/base/content/dialogs/calendar-print-dialog.js
+++ b/calendar/base/content/dialogs/calendar-print-dialog.js
@@ -76,17 +76,17 @@ function getPrintSettings(receiverFunc) 
     settings.layoutCId = document.getElementById("layout-field").value;
     settings.start = null;
     settings.end = null;
     settings.eventList = [];
     settings.printEvents = document.getElementById("events").checked;
     settings.printTasks = document.getElementById("tasks").checked;
     settings.printCompletedTasks = document.getElementById("completed-tasks").checked;
     settings.printTasksWithNoDueDate = document.getElementById("tasks-with-no-due-date").checked;
-    var theView = getCalendarView();
+    let theView = getCalendarView();
     switch (document.getElementById("view-field").selectedItem.value) {
     case 'currentView':
     case '': // just in case
         settings.start = theView.startDay.clone();
         settings.end = theView.endDay.clone();
         settings.end.day += 1;
         settings.start.isDate = false;
         settings.end.isDate = false;
@@ -102,17 +102,17 @@ function getPrintSettings(receiverFunc) 
             }
             return true;
         });
 
         // If tasks should be printed, also include selected tasks from the
         // opening window.
         if (settings.printTasks) {
             let selectedTasks = window.opener.getSelectedTasks();
-            for (var task of selectedTasks) {
+            for (let task of selectedTasks) {
                 settings.eventList.push(task);
             }
         }
 
         // We've set the event list above, no need to fetch items below.
         requiresFetch = false;
         break;
     }
@@ -141,17 +141,17 @@ function getPrintSettings(receiverFunc) 
             function onOperationComplete(aCalendar, aStatus, aOperationType, aId, aDateTime) {
                 receiverFunc(settings);
             },
             onGetResult:
             function onGetResult(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 settings.eventList = settings.eventList.concat(aItems);
                 if (!settings.printTasksWithNoDueDate) {
                     eventWithDueDate = [];
-                    for (var item of settings.eventList) {
+                    for (let item of settings.eventList) {
                         if (item.dueDate || item.endDate) {
                             eventWithDueDate.push(item);
                         }
                     }
                     settings.eventList = eventWithDueDate;
                 }
             }
         };
@@ -262,28 +262,28 @@ var closeOnComplete = {
 };
 
 /**
  * Prints the document and then closes the window
  */
 function printAndClose() {
     refreshHtml(
         function finish() {
-            var webBrowserPrint = PrintUtils.getWebBrowserPrint();
-            var printSettings = PrintUtils.getPrintSettings();
+            let webBrowserPrint = PrintUtils.getWebBrowserPrint();
+            let printSettings = PrintUtils.getPrintSettings();
 
             // Evicts "about:blank" header
             printSettings.docURL = " ";
 
             // Start the printing, this is just what PrintUtils does, but we
             // apply our own settings.
             try {
                 webBrowserPrint.print(printSettings, closeOnComplete);
                 if (gPrintSettingsAreGlobal && gSavePrintSettings) {
-                    var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
+                    let PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
                                           .getService(Components.interfaces.nsIPrintSettingsService);
                     PSSVC.savePrintSettingsToPrefs(printSettings, true,
                                                         printSettings.kInitSaveAll);
                     PSSVC.savePrintSettingsToPrefs(printSettings, false,
                                                    printSettings.kInitSavePrinterName);
                 }
             } catch (e) {
                 // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
--- a/calendar/base/content/dialogs/calendar-subscriptions-dialog.js
+++ b/calendar/base/content/dialogs/calendar-subscriptions-dialog.js
@@ -59,23 +59,23 @@ function onTextBoxKeyPress(event) {
 }
 
 /**
  * Handler function to be called when the accept button is pressed.
  *
  * @return      Returns true if the window should be closed
  */
 function onAccept() {
-    var richListBox = document.getElementById("subscriptions-listbox");
-    var rowCount = richListBox.getRowCount();
-    for (var i = 0; i < rowCount; i++) {
-        var richListItem = richListBox.getItemAtIndex(i);
-        var checked = richListItem.checked;
+    let richListBox = document.getElementById("subscriptions-listbox");
+    let rowCount = richListBox.getRowCount();
+    for (let i = 0; i < rowCount; i++) {
+        let richListItem = richListBox.getItemAtIndex(i);
+        let checked = richListItem.checked;
         if (checked != richListItem.subscribed) {
-            var calendar = richListItem.calendar;
+            let calendar = richListItem.calendar;
             if (checked) {
                 getCalendarManager().registerCalendar(calendar);
             } else {
                 getCalendarManager().unregisterCalendar(calendar);
             }
         }
     }
     return true;
@@ -127,24 +127,24 @@ function onSearch() {
     }
 }
 
 /**
  * Markes the selected item in the subscriptions-listbox for subscribing. The
  * actual subscribe happens when the window is closed.
  */
 function onSubscribe() {
-    var item = document.getElementById("subscriptions-listbox").selectedItem;
+    let item = document.getElementById("subscriptions-listbox").selectedItem;
     if (item && !item.disabled) {
         item.checked = true;
     }
 }
 
 /**
  * Unmarkes the selected item in the subscriptions-listbox for subscribing. The
  * actual subscribe happens when the window is closed.
  */
 function onUnsubscribe() {
-    var item = document.getElementById("subscriptions-listbox").selectedItem;
+    let item = document.getElementById("subscriptions-listbox").selectedItem;
     if (item && !item.disabled) {
         item.checked = false;
     }
 }
--- a/calendar/base/content/dialogs/calendar-summary-dialog.js
+++ b/calendar/base/content/dialogs/calendar-summary-dialog.js
@@ -7,30 +7,30 @@ Components.utils.import("resource://cale
 Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
 Components.utils.import("resource://calendar/modules/calRecurrenceUtils.jsm");
 
 /**
  * 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;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
     item = item.clone(); // use an own copy of the passed item
     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.
     if (args.job) {
         // keep this context...
-        var self = this;
+        let self = this;
 
         // store the 'finalize'-functor in the provided job-object.
         args.job.finalize = function finalize() {
             // store any pending modifications...
             self.onAccept();
 
             let calendarItem = window.calendarItem;
 
@@ -52,17 +52,17 @@ function onLoad() {
 
     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);
+        let attendee = calendar.getInvitedAttendee(item);
         if (attendee) {
             // if this is an unresponded invitation, preset our default alarm values:
             if (!item.getAlarms({}).length &&
                 (attendee.participationStatus == "NEEDS-ACTION")) {
                 cal.alarms.setDefaultValues(item);
             }
 
             window.attendee = attendee.clone();
@@ -85,41 +85,41 @@ 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.
     let argCalendar = window.arguments[0].calendarEvent.calendar;
-    var supportsReminders =
+    let supportsReminders =
         (argCalendar.getProperty("capabilities.alarms.oninvitations.supported") !== false);
     if (!window.readOnly && supportsReminders) {
         document.getElementById("reminder-row").removeAttribute("hidden");
         loadReminders(window.calendarItem.getAlarms({}));
         updateReminder();
     }
 
     updateRepeatDetails();
     updateAttendees();
     updateLink();
 
-    var location = item.getProperty("LOCATION");
+    let location = item.getProperty("LOCATION");
     if (location && location.length) {
         document.getElementById("location-row").removeAttribute("hidden");
         document.getElementById("item-location").value = location;
     }
 
-    var categories = item.getCategories({});
+    let categories = item.getCategories({});
     if (categories.length > 0) {
         document.getElementById("category-row").removeAttribute("hidden");
         document.getElementById("item-category").value = categories.join(", "); // TODO l10n-unfriendly
     }
 
-    var organizer = item.organizer;
+    let organizer = item.organizer;
     if (organizer && organizer.id) {
         document.getElementById("organizer-row").removeAttribute("hidden");
         let cell = document.getElementsByClassName("item-organizer-cell")[0];
         let text = cell.getElementsByTagName("label")[0];
         let icon = cell.getElementsByTagName("img")[0];
 
         let role = organizer.role || "REQ-PARTICIPANT";
         let ut = organizer.userType || "INDIVIDUAL";
@@ -137,39 +137,39 @@ function onLoad() {
 
         text.setAttribute("value", orgName);
         cell.setAttribute("tooltiptext", tt);
         icon.setAttribute("partstat", ps);
         icon.setAttribute("usertype", ut);
         icon.setAttribute("role", role);
     }
 
-    var status = item.getProperty("STATUS");
+    let status = item.getProperty("STATUS");
     if (status && status.length) {
-        var statusRow = document.getElementById("status-row");
-        for (var i = 0; i < statusRow.childNodes.length; i++) {
+        let statusRow = document.getElementById("status-row");
+        for (let i = 0; i < statusRow.childNodes.length; i++) {
             if (statusRow.childNodes[i].getAttribute("status") == status) {
                 statusRow.removeAttribute("hidden");
                 if (status == "CANCELLED" && cal.isToDo(item)) {
                     // There are two labels for CANCELLED, the second one is for
                     // todo items. Increment the counter here.
                     i++;
                 }
                 statusRow.childNodes[i].removeAttribute("hidden");
                 break;
             }
         }
     }
 
     if (item.hasProperty("DESCRIPTION")) {
-        var description = item.getProperty("DESCRIPTION");
+        let description = item.getProperty("DESCRIPTION");
         if (description && description.length) {
             document.getElementById("item-description-box")
                 .removeAttribute("hidden");
-            var textbox = document.getElementById("item-description");
+            let textbox = document.getElementById("item-description");
             textbox.value = description;
             textbox.inputField.readOnly = true;
         }
     }
 
     document.title = item.title;
 
     // If this item is read only we remove the 'cancel' button as users
@@ -187,20 +187,20 @@ function onLoad() {
  *
  * @return      Returns true if the dialog
  */
 function onAccept() {
     dispose();
     if (window.readOnly) {
         return true;
     }
-    var args = window.arguments[0];
-    var oldItem = args.calendarEvent;
-    var newItem = window.calendarItem;
-    var calendar = newItem.calendar;
+    let args = window.arguments[0];
+    let oldItem = args.calendarEvent;
+    let newItem = window.calendarItem;
+    let calendar = newItem.calendar;
     saveReminder(newItem);
     args.onOk(newItem, calendar, oldItem);
     window.calendarItem = newItem;
     return true;
 }
 
 /**
  * Called when closing the dialog and any changes should be thrown away.
@@ -212,32 +212,32 @@ function onCancel() {
 
 /**
  * Sets the dialog's invitation status dropdown to the value specified by the
  * user's invitation status.
  */
 function updateInvitationStatus() {
     if (!window.readOnly) {
         if (window.attendee) {
-            var invitationRow =
+            let invitationRow =
                 document.getElementById("invitation-row");
             invitationRow.removeAttribute("hidden");
-            var statusElement =
+            let statusElement =
                 document.getElementById("item-participation");
             statusElement.value = window.attendee.participationStatus;
         }
     }
 }
 
 /**
  * When the summary dialog is showing an invitation, this function updates the
  * user's invitation status from the value chosen in the dialog.
  */
 function updatePartStat() {
-  var statusElement = document.getElementById("item-participation");
+  let statusElement = document.getElementById("item-participation");
   if (window.attendee) {
       let item = window.arguments[0];
       let aclEntry = item.calendar.aclEntry;
       if (aclEntry) {
           let userAddresses = aclEntry.getUserAddresses({});
           if (userAddresses.length > 0
               && !cal.attendeeMatchesAddresses(window.attendee, userAddresses)) {
               window.attendee.setProperty("SENT-BY", "mailto:" + userAddresses[0]);
@@ -248,63 +248,63 @@ function updatePartStat() {
   }
 }
 
 /**
  * Updates the dialog w.r.t recurrence, i.e shows a text describing the item's
  * recurrence)
  */
 function updateRepeatDetails() {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
 
     // step to the parent (in order to show the
     // recurrence info which is stored at the parent).
     item = item.parentItem;
 
     // retrieve a valid recurrence rule from the currently
     // set recurrence info. bail out if there's more
     // than a single rule or something other than a rule.
-    var recurrenceInfo = item.recurrenceInfo;
+    let recurrenceInfo = item.recurrenceInfo;
     if (!recurrenceInfo) {
         return;
     }
 
     document.getElementById("repeat-row").removeAttribute("hidden");
 
     // First of all collapse the details text. If we fail to
     // create a details string, we simply don't show anything.
     // this could happen if the repeat rule is something exotic
     // we don't have any strings prepared for.
-    var repeatDetails = document.getElementById("repeat-details");
+    let repeatDetails = document.getElementById("repeat-details");
     repeatDetails.setAttribute("collapsed", "true");
 
     // Try to create a descriptive string from the rule(s).
-    var kDefaultTimezone = calendarDefaultTimezone();
-    var startDate = item.startDate || item.entryDate;
-    var endDate = item.endDate || item.dueDate;
+    let kDefaultTimezone = calendarDefaultTimezone();
+    let startDate = item.startDate || item.entryDate;
+    let endDate = item.endDate || item.dueDate;
     startDate = startDate ? startDate.getInTimezone(kDefaultTimezone) : null;
     endDate = endDate ? endDate.getInTimezone(kDefaultTimezone) : null;
-    var detailsString = recurrenceRule2String(recurrenceInfo, startDate,
+    let detailsString = recurrenceRule2String(recurrenceInfo, startDate,
                                               endDate, startDate.isDate);
 
     if (!detailsString) {
         detailsString = cal.calGetString("calendar-event-dialog", "ruleTooComplexSummary");
     }
 
     // Now display the string...
-    var lines = detailsString.split("\n");
+    let lines = detailsString.split("\n");
     repeatDetails.removeAttribute("collapsed");
     while (repeatDetails.childNodes.length > lines.length) {
         repeatDetails.lastChild.remove();
     }
-    var numChilds = repeatDetails.childNodes.length;
-    for (var i = 0; i < lines.length; i++) {
+    let numChilds = repeatDetails.childNodes.length;
+    for (let i = 0; i < lines.length; i++) {
         if (i >= numChilds) {
-            var newNode = repeatDetails.firstChild
+            let newNode = repeatDetails.firstChild
                                        .cloneNode(true);
             repeatDetails.appendChild(newNode);
         }
         repeatDetails.childNodes[i].value = lines[i];
         repeatDetails.childNodes[i].setAttribute("tooltiptext", detailsString);
     }
 }
 
@@ -328,19 +328,19 @@ function updateReminder() {
 }
 
 /**
  * Browse the item's attached URL.
  *
  * XXX This function is broken, should be fixed in bug 471967
  */
 function browseDocument() {
-    var args = window.arguments[0];
-    var item = args.calendarEvent;
-    var url = item.getProperty("URL");
+    let args = window.arguments[0];
+    let item = args.calendarEvent;
+    let url = item.getProperty("URL");
     launchBrowser(url);
 }
 
 /**
  * Extracts the item's organizer and opens a compose window to send the
  * organizer an email.
  */
 function sendMailToOrganizer() {
--- a/calendar/base/content/import-export.js
+++ b/calendar/base/content/import-export.js
@@ -138,26 +138,26 @@ function putItemsIntoCal(destCal, aItems
 
     // And set batch mode on the calendar, to tell the views to not
     // redraw until all items are imported
     destCal.startBatch();
 
     // This listener is needed to find out when the last addItem really
     // finished. Using a counter to find the last item (which might not
     // be the last item added)
-    var count = 0;
-    var failedCount = 0;
-    var duplicateCount = 0;
+    let count = 0;
+    let failedCount = 0;
+    let duplicateCount = 0;
     // Used to store the last error. Only the last error, because we don't
     // wan't to bomb the user with thousands of error messages in case
     // something went really wrong.
     // (example of something very wrong: importing the same file twice.
     //  quite easy to trigger, so we really should do this)
-    var lastError;
-    var listener = {
+    let lastError;
+    let listener = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
         onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
             count++;
             if (!Components.isSuccessCode(aStatus)) {
                 if (aStatus == Components.interfaces.calIErrors.DUPLICATE_ID) {
                     duplicateCount++;
                 } else {
                     failedCount++;
@@ -313,45 +313,45 @@ function saveEventsToFile(calendarEventA
 
 /**
  * Exports all the events and tasks in a calendar.  If aCalendar is not specified,
  * the user will be prompted with a list of calendars to choose which one to export.
  *
  * @param aCalendar     (optional) A specific calendar to export
  */
 function exportEntireCalendar(aCalendar) {
-    var itemArray = [];
-    var getListener = {
+    let itemArray = [];
+    let getListener = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
         onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDetail) {
             saveEventsToFile(itemArray, aOpCalendar.name);
         },
         onGetResult: function(aOpCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
             for (let item of aItems) {
                 itemArray.push(item);
             }
         }
     };
 
-    function getItemsFromCal(aCal) {
+    let getItemsFromCal = function(aCal) {
         aCal.getItems(Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS,
                       0, null, null, getListener);
-    }
+    };
 
     if (!aCalendar) {
-        var count = {};
-        var calendars = getCalendarManager().getCalendars(count);
+        let count = {};
+        let calendars = getCalendarManager().getCalendars(count);
 
         if (count.value == 1) {
             // There's only one calendar, so it's silly to ask what calendar
             // the user wants to import into.
             getItemsFromCal(calendars[0]);
         } else {
             // Ask what calendar to import into
-            var args = {};
+            let args = {};
             args.onOk = getItemsFromCal;
             args.promptText = calGetString("calendar", "exportPrompt");
             openDialog("chrome://calendar/content/chooseCalendarDialog.xul",
                        "_blank", "chrome,titlebar,modal,resizable", args);
         }
     } else {
         getItemsFromCal(aCalendar);
     }
--- a/calendar/base/content/preferences/alarms.js
+++ b/calendar/base/content/preferences/alarms.js
@@ -28,85 +28,85 @@ var gAlarmsPane = {
      * Converts the given file url to a nsILocalFile
      *
      * @param aFileURL    A string with a file:// url.
      * @return            The corresponding nsILocalFile.
      */
     convertURLToLocalFile: function gAP_convertURLToLocalFile(aFileURL) {
         // Convert the file url into a nsILocalFile
         if (aFileURL) {
-            var fph = Services.io
+            let fph = Services.io
                          .getProtocolHandler("file")
                          .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
             return fph.getFileFromURLSpec(aFileURL);
         } else {
             return null;
         }
     },
 
     /**
      * Handler function to be called when the calendar.alarms.soundURL pref has
      * changed. Updates the label in the dialog.
      */
     readSoundLocation: function gAP_readSoundLocation() {
-        var soundUrl = document.getElementById("alarmSoundFileField");
+        let soundUrl = document.getElementById("alarmSoundFileField");
         soundUrl.value = document.getElementById("calendar.alarms.soundURL").value;
         if (soundUrl.value.startsWith("file://")) {
             soundUrl.label = this.convertURLToLocalFile(soundUrl.value).leafName;
         } else {
             soundUrl.label = soundUrl.value;
         }
         soundUrl.image = "moz-icon://" + soundUrl.label + "?size=16";
         return undefined;
     },
 
     /**
      * Causes the default sound to be selected in the dialog controls
      */
     useDefaultSound: function gAP_useDefaultSound() {
-        var defaultSoundUrl = "chrome://calendar/content/sound.wav";
+        let defaultSoundUrl = "chrome://calendar/content/sound.wav";
         document.getElementById("calendar.alarms.soundURL").value = defaultSoundUrl;
         document.getElementById("alarmSoundCheckbox").checked = true;
         this.readSoundLocation();
     },
 
     /**
      * Opens a filepicker to open a local sound for the alarm.
      */
     browseAlarm: function gAP_browseAlarm() {
         const nsIFilePicker = Components.interfaces.nsIFilePicker;
-        var fp = Components.classes["@mozilla.org/filepicker;1"]
+        let fp = Components.classes["@mozilla.org/filepicker;1"]
                     .createInstance(nsIFilePicker);
 
-        var bundlePreferences = document.getElementById("bundleCalendarPreferences");
-        var title = bundlePreferences.getString("Open");
-        var wildmat = "*.wav";
-        var label = bundlePreferences.getFormattedString("filterWav", [wildmat], 1);
+        let bundlePreferences = document.getElementById("bundleCalendarPreferences");
+        let title = bundlePreferences.getString("Open");
+        let wildmat = "*.wav";
+        let label = bundlePreferences.getFormattedString("filterWav", [wildmat], 1);
 
         fp.init(window, title, nsIFilePicker.modeOpen);
         fp.appendFilter(label, wildmat);
         fp.appendFilters(nsIFilePicker.filterAll);
 
-        var ret = fp.show();
+        let ret = fp.show();
 
         if (ret == nsIFilePicker.returnOK) {
             document.getElementById("calendar.alarms.soundURL").value = fp.fileURL.spec;
             document.getElementById("alarmSoundCheckbox").checked = true;
             this.readSoundLocation();
         }
     },
 
     /**
      * Plays the alarm sound currently selected.
      */
     previewAlarm: function gAP_previewAlarm() {
-        var soundUrl = document.getElementById("alarmSoundFileField").value;
-        var soundIfc = Components.classes["@mozilla.org/sound;1"]
+        let soundUrl = document.getElementById("alarmSoundFileField").value;
+        let soundIfc = Components.classes["@mozilla.org/sound;1"]
                             .createInstance(Components.interfaces.nsISound);
-        var url;
+        let url;
         try {
             soundIfc.init();
             if (soundUrl && soundUrl.length && soundUrl.length > 0) {
                 url = Services.io.newURI(soundUrl, null, null);
                 soundIfc.play(url);
             } else {
                 soundIfc.beep();
             }
@@ -116,21 +116,21 @@ var gAlarmsPane = {
     },
 
     /**
      * Handler function to call when the calendar.alarms.playsound preference
      * has been changed. Updates the disabled state of fields that depend on
      * playing a sound.
      */
     alarmsPlaySoundPrefChanged: function gAP_alarmsPlaySoundPrefChanged() {
-        var alarmsPlaySoundPref =
+        let alarmsPlaySoundPref =
             document.getElementById("calendar.alarms.playsound");
 
-        var items = [document.getElementById("alarmSoundFileField"),
+        let items = [document.getElementById("alarmSoundFileField"),
                      document.getElementById("calendar.prefs.alarm.sound.useDefault"),
                      document.getElementById("calendar.prefs.alarm.sound.browse"),
                      document.getElementById("calendar.prefs.alarm.sound.play")];
 
-        for (var i = 0; i < items.length; i++) {
+        for (let i = 0; i < items.length; i++) {
             items[i].disabled = !alarmsPlaySoundPref.value;
         }
     }
 };
--- a/calendar/base/content/preferences/categories.js
+++ b/calendar/base/content/preferences/categories.js
@@ -18,19 +18,19 @@ var gCategoriesPane = {
     /**
      * Initialize the categories pref pane. Sets up dialog controls to show the
      * categories saved in preferences.
      */
     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;
+        let parentPrefWindow = document.documentElement;
         if (!parentPrefWindow.instantApply) {
-            var existingOnDialogCancel = parentPrefWindow.getAttribute("ondialogcancel");
+            let existingOnDialogCancel = parentPrefWindow.getAttribute("ondialogcancel");
             parentPrefWindow.setAttribute("ondialogcancel",
                                           "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)) {
@@ -75,25 +75,25 @@ var gCategoriesPane = {
         listbox.clearSelection();
         this.updateButtons();
 
 
         while (listbox.lastChild.id != "categoryColumns") {
             listbox.lastChild.remove();
         }
 
-        for (var i = 0; i < gCategoryList.length; i++) {
-            var newListItem = document.createElement("listitem");
-            var categoryName = document.createElement("listcell");
+        for (let i = 0; i < gCategoryList.length; i++) {
+            let newListItem = document.createElement("listitem");
+            let categoryName = document.createElement("listcell");
             categoryName.setAttribute("id", gCategoryList[i]);
             categoryName.setAttribute("label", gCategoryList[i]);
-            var categoryNameFix = formatStringForCSSRule(gCategoryList[i]);
-            var categoryColor = document.createElement("listcell");
+            let categoryNameFix = formatStringForCSSRule(gCategoryList[i]);
+            let categoryColor = document.createElement("listcell");
             try {
-                var colorCode = categoryPrefBranch.getCharPref(categoryNameFix);
+                let colorCode = categoryPrefBranch.getCharPref(categoryNameFix);
                 categoryColor.setAttribute("id", colorCode);
                 categoryColor.setAttribute("style", "background-color: " + colorCode + ";");
             } catch (ex) {
                 categoryColor.setAttribute("label", noneLabel);
             }
 
             newListItem.appendChild(categoryName);
             newListItem.appendChild(categoryColor);
@@ -183,20 +183,20 @@ var gCategoriesPane = {
 
     /**
      * Saves the given category to the preferences.
      *
      * @param categoryName      The name of the category.
      * @param categoryColor     The color of the category
      */
     saveCategory: function gCP_saveCateogry(categoryName, categoryColor) {
-        var list = document.getElementById("categorieslist");
+        let list = document.getElementById("categorieslist");
         // Check to make sure another category doesn't have the same name
-        var toBeDeleted = -1;
-        for (var i = 0; i < gCategoryList.length; i++) {
+        let toBeDeleted = -1;
+        for (let i = 0; i < gCategoryList.length; i++) {
             if (i == list.selectedIndex) {
                 continue;
             }
 
             if (categoryName.toLowerCase() == gCategoryList[i].toLowerCase()) {
                 if (Services.prompt.confirm(null, overwriteTitle, overwrite)) {
                     if (list.selectedIndex != -1) {
                         // Don't delete the old category yet. It will mess up indices.
@@ -209,17 +209,17 @@ var gCategoriesPane = {
             }
         }
 
         if (categoryName.length == 0) {
             Services.prompt.alert(null, null, noBlankCategories);
             return;
         }
 
-        var categoryNameFix = formatStringForCSSRule(categoryName);
+        let categoryNameFix = formatStringForCSSRule(categoryName);
         if (list.selectedIndex == -1) {
             this.backupData(categoryNameFix);
             gCategoryList.push(categoryName);
             if (categoryColor) {
                 categoryPrefBranch.setCharPref(categoryNameFix, categoryColor);
             }
         } else {
             this.backupData(categoryNameFix);
@@ -238,17 +238,17 @@ var gCategoriesPane = {
         // If 'Overwrite' was chosen, delete category that was being edited
         if (toBeDeleted != -1) {
             list.selectedIndex = toBeDeleted;
             this.deleteCategory();
         }
 
         this.updateCategoryList();
 
-        var updatedCategory = gCategoryList.indexOf(categoryName);
+        let updatedCategory = gCategoryList.indexOf(categoryName);
         list.ensureIndexIsVisible(updatedCategory);
         list.selectedIndex = updatedCategory;
     },
 
     /**
      * Enable the edit and delete category buttons.
      */
     updateButtons: function gCP_updateButtons() {
@@ -259,25 +259,25 @@ var gCategoriesPane = {
 
     /**
      * Backs up the category name in case the dialog is canceled.
      *
      * @see formatStringForCSSRule
      * @param categoryNameFix     The formatted category name.
      */
     backupData: function gCP_backupData(categoryNameFix) {
-        var currentColor;
+        let currentColor;
         try {
             currentColor = categoryPrefBranch.getCharPref(categoryNameFix);
         } catch (ex) {
             dump("Exception caught in 'backupData': " + ex + "\n");
             currentColor = "##NEW";
         }
 
-        for (var i = 0; i < parent.backupPrefList.length; i++) {
+        for (let i = 0; i < parent.backupPrefList.length; i++) {
             if (categoryNameFix == parent.backupPrefList[i].name) {
                 return;
             }
         }
         parent.backupPrefList[parent.backupPrefList.length] =
             { name: categoryNameFix, color: currentColor };
     },
 
@@ -292,17 +292,17 @@ var gCategoriesPane = {
             this.editCategory();
         }
     },
 
     /**
      * Reverts category preferences in case the cancel button is pressed.
      */
     panelOnCancel: function gCP_panelOnCancel() {
-        for (var i = 0; i < parent.backupPrefList.length; i++) {
+        for (let i = 0; i < parent.backupPrefList.length; i++) {
             if (parent.backupPrefList[i].color == "##NEW") {
                 try {
                    categoryPrefBranch.clearUserPref(parent.backupPrefList[i].name);
                 } catch (ex) {
                     dump("Exception caught in 'panelOnCancel': " + ex + "\n");
                 }
             } else {
                 categoryPrefBranch.setCharPref(parent.backupPrefList[i].name,
--- a/calendar/base/content/preferences/general.js
+++ b/calendar/base/content/preferences/general.js
@@ -10,21 +10,21 @@ Components.utils.import("resource://cale
  * Global Object to hold methods for the general pref pane
  */
 var gCalendarGeneralPane = {
     /**
      * Initialize the general pref pane. Sets up dialog controls to match the
      * values set in prefs.
      */
     init: function gCGP_init() {
-        var df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+        let df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
                     .getService(Components.interfaces.calIDateTimeFormatter);
 
-        var dateFormattedLong = df.formatDateLong(now());
-        var dateFormattedShort = df.formatDateShort(now());
+        let dateFormattedLong = df.formatDateLong(now());
+        let dateFormattedShort = df.formatDateShort(now());
 
         // menu items include examples of current date formats.
         document.getElementById("dateformat-long-menuitem")
                 .setAttribute("label", labelLong + ": " + dateFormattedLong);
         document.getElementById("dateformat-short-menuitem")
                 .setAttribute("label", labelShort + ": " + dateFormattedShort);
 
         // deselect and reselect to update visible item title
--- a/calendar/base/content/preferences/views.js
+++ b/calendar/base/content/preferences/views.js
@@ -19,23 +19,23 @@ var gViewsPane = {
         this.initializeViewStartEndMenus();
     },
 
     /**
      * Initialize the strings for the  "day starts at" and "day ends at"
      * menulists. This is needed to respect locales that use AM/PM.
      */
     initializeViewStartEndMenus: function gVP_initializeViewStartEndMenus() {
-        var labelIdStart;
-        var labelIdEnd;
-        var timeFormatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
+        let labelIdStart;
+        let labelIdEnd;
+        let timeFormatter = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                                       .getService(Components.interfaces.nsIScriptableDateFormat);
         // 1 to 23 instead of 0 to 24 to keep midnight & noon as the localized strings
-        for (var theHour = 1; theHour <= 23; theHour++) {
-            var time = timeFormatter.FormatTime("", Components.interfaces.nsIScriptableDateFormat
+        for (let theHour = 1; theHour <= 23; theHour++) {
+            let time = timeFormatter.FormatTime("", Components.interfaces.nsIScriptableDateFormat
                                     .timeFormatNoSeconds, theHour, 0, 0);
 
             labelIdStart = "timeStart" + theHour;
             labelIdEnd = "timeEnd" + theHour;
             // This if block to keep Noon as the localized string, instead of as a number.
             if (theHour != 12) {
                 document.getElementById(labelIdStart).setAttribute("label", time);
                 document.getElementById(labelIdEnd).setAttribute("label", time);
@@ -49,51 +49,51 @@ var gViewsPane = {
 
     /**
      * Updates the view end menu to only display hours after the selected view
      * start.
      *
      * @param aStartValue       The value selected for view start.
      */
     updateViewEndMenu: function gVP_updateViewEndMenu(aStartValue) {
-        var endMenuKids = document.getElementById("dayendhourpopup")
+        let endMenuKids = document.getElementById("dayendhourpopup")
                                   .childNodes;
-        for (var i = 0; i < endMenuKids.length; i++) {
+        for (let i = 0; i < endMenuKids.length; i++) {
             if (Number(endMenuKids[i].value) <= Number(aStartValue)) {
                 endMenuKids[i].setAttribute("hidden", true);
             } else {
                 endMenuKids[i].removeAttribute("hidden");
             }
         }
     },
 
     /**
      * Updates the view start menu to only display hours before the selected view
      * end.
      *
      * @param aEndValue         The value selected for view end.
      */
     updateViewStartMenu: function gVP_updateViewStartMenu(aEndValue) {
-        var startMenuKids = document.getElementById("daystarthourpopup")
+        let startMenuKids = document.getElementById("daystarthourpopup")
                                   .childNodes;
-        for (var i = 0; i < startMenuKids.length; i++) {
+        for (let i = 0; i < startMenuKids.length; i++) {
             if (Number(startMenuKids[i].value) >= Number(aEndValue)) {
                 startMenuKids[i].setAttribute("hidden", true);
             } else {
                 startMenuKids[i].removeAttribute("hidden");
             }
         }
     },
 
     /**
      * Update the workday checkboxes based on the start of the week.
      *
      * @Param weekStart         The (0-based) index of the weekday the week
      *                            should start at.
      */
     updateViewWorkDayCheckboxes: function gVP_updateViewWorkDayCheckboxes(weekStart) {
         weekStart = Number(weekStart);
-        for (var i = weekStart; i < weekStart + 7; i++) {
-            var checkbox = document.getElementById("dayoff" + (i % 7));
+        for (let i = weekStart; i < weekStart + 7; i++) {
+            let checkbox = document.getElementById("dayoff" + (i % 7));
             checkbox.parentNode.appendChild(checkbox);
         }
     }
 };
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -146,18 +146,18 @@
         onPropertyDeleting: function cO_onPropertyDeleting(aCalendar,
                                                             aName) {
         }
       })
       ]]></field>
     </implementation>
     <handlers>
       <handler event="dblclick"><![CDATA[
-        var col = {};
-        var calendar = this.getCalendarFromEvent(event, col);
+        let col = {};
+        let calendar = this.getCalendarFromEvent(event, col);
         if (event.button != 0 ||
             (col.value && col.value.element &&
              col.value.element.getAttribute("anonid") == "checkbox-treecol")) {
             // Only left clicks that are not on the checkbox column
             return;
         }
         if (calendar) {
             openCalendarProperties(calendar);
@@ -439,17 +439,17 @@
         <!--
           - Find the array index of the calendar with the passed id.
           -
           - @param aId           The calendar id to find an index for.
           - @return              The array index, or -1 if not found.
           -->
         <parameter name="aId"/>
         <body><![CDATA[
-          for (var i = 0; i < this.mCalendarList.length; i++) {
+          for (let i = 0; i < this.mCalendarList.length; i++) {
               if (this.mCalendarList[i].id == aId) {
                   return i;
               }
           }
           return -1;
         ]]></body>
       </method>
 
--- a/calendar/base/content/widgets/calendar-subscriptions-list.xml
+++ b/calendar/base/content/widgets/calendar-subscriptions-list.xml
@@ -18,17 +18,17 @@
     <implementation>
 
       <!-- methods -->
 
       <method name="addCalendar">
         <parameter name="aCalendar"/>
         <parameter name="bSubscribed"/>
         <body><![CDATA[
-          var newNode = createXULElement("calendar-subscriptions-richlistitem");
+          let newNode = createXULElement("calendar-subscriptions-richlistitem");
           this.appendChild(newNode);
           newNode.setAttribute("anonid", "subscriptions-listitem");
           newNode.calendar = aCalendar;
           newNode.subscribed = bSubscribed;
         ]]></body>
       </method>
 
       <method name="clear">
@@ -78,48 +78,48 @@
           this.mSubscribed = val;
           this.checked = val;
           return val;
         ]]></setter>
       </property>
 
       <property name="checked">
         <getter><![CDATA[
-          var checkbox = document.getAnonymousElementByAttribute(
+          let checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (checkbox.getAttribute("checked") == "true") {
             return true;
           } else {
             return false;
           }
         ]]></getter>
         <setter><![CDATA[
-          var checkbox = document.getAnonymousElementByAttribute(
+          let checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (val) {
             checkbox.setAttribute("checked", "true");
           } else {
             checkbox.removeAttribute("checked");
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="disabled">
         <getter><![CDATA[
-          var checkbox = document.getAnonymousElementByAttribute(
+          let checkbox = document.getAnonymousElementByAttribute(
             this, "an