diff -u8pdNr 1.6/chrome/content/customcalendardefaults.js 1.7/chrome/content/customcalendardefaults.js
--- 1.6/chrome/content/customcalendardefaults.js	2015-08-04 19:14:22.531006700 +0200
+++ 1.7/chrome/content/customcalendardefaults.js	2017-04-28 21:19:31.066584300 +0200
@@ -90,26 +90,25 @@ function setCustomCalendarDefaultsEventD
 /*******************************
 * Modified Lightning functions *
 *******************************/
 
 /**
 * calendar-item-editing.js: function createEventWithDialog
 */
 function ccdCreateEventWithDialog(calendar, startDate, endDate, summary, event, aForceAllday) {
-    const kDefaultTimezone = calendarDefaultTimezone();
 
-    var onNewEvent = function(item, calendar, 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, calendar, originalItem, listener);
+            doTransaction("modify", item, opcalendar, originalItem, listener);
         } else {
             // Otherwise, this is an addition
-            doTransaction('add', item, calendar, null, listener);
+            doTransaction("add", item, opcalendar, null, listener);
         }
     };
 
     if (event) {
         if (!event.isMutable) {
             event = event.clone();
         }
         // If the event should be created from a template, then make sure to
@@ -135,35 +134,34 @@ function ccdCreateEventWithDialog(calend
 
         let refDate = currentView().initialized && currentView().selectedDay.clone();
         setDefaultItemValues(event, calendar, startDate, endDate, refDate, aForceAllday);
         if (summary) {
             event.title = summary;
         }
     }
     setCustomCalendarDefaults(event);
-    openEventDialog(event, event.calendar, "new", onNewEvent, null);
+    openEventDialog(event, event.calendar, "new", onNewEvent);
 }
 
 /**
 * calendar-item-editing.js: function createTodoWithDialog
 */
 function ccdCreateTodoWithDialog(calendar, dueDate, summary, todo, initialDate) {
-    const kDefaultTimezone = calendarDefaultTimezone();
 
-    var onNewItem = function(item, calendar, 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, calendar, originalItem, listener);
+            doTransaction("modify", item, opcalendar, originalItem, listener);
         } else {
             // Otherwise, this is an addition
-            doTransaction('add', item, calendar, null, listener);
+            doTransaction("add", item, opcalendar, null, listener);
         }
-    }
+    };
 
     if (todo) {
         // If the todo should be created from a template, then make sure to
         // remove the id so that the item obtains a new id when doing the
         // transaction
         if (todo.id) {
             todo = todo.clone();
             todo.id = null;
@@ -196,152 +194,152 @@ var ccdTaskEdit = {
     get observedCalendar() {
         return this.mObservedCalendar;
     },
 
     /**
      * Set the currently observed calendar, removing listeners to any old
      * calendar set and adding listeners to the new one.
      */
-    set observedCalendar(v) {
+    set observedCalendar(aCalendar) {
         if (this.mObservedCalendar) {
             this.mObservedCalendar.removeObserver(this.calendarObserver);
         }
 
-        this.mObservedCalendar = v;
+        this.mObservedCalendar = aCalendar;
 
         if (this.mObservedCalendar) {
             this.mObservedCalendar.addObserver(this.calendarObserver);
         }
         return this.mObservedCalendar;
     },
 
     /**
      * Helper function to set readonly and aria-disabled states and the value
      * for a given target.
      *
      * @param aTarget   The ID or XUL node to set the value
      * @param aDisable  A boolean if the target should be disabled.
      * @param aValue    The value that should be set on the target.
      */
-    setupTaskField: function tE_setupTaskField(aTarget, aDisable, aValue) {
+    setupTaskField: function(aTarget, aDisable, aValue) {
         aTarget.value = aValue;
         setElementValue(aTarget, aDisable && "true", "readonly");
         setElementValue(aTarget, aDisable && "true", "aria-disabled");
     },
 
     /**
      * 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;
+    onFocus: function(aEvent) {
+        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)) {
+        } else if (isCalendarWritable(calendar)) {
+            edit.showsInstructions = false;
+            taskEdit.setupTaskField(edit, false, edit.savedValue || "");
+        } else {
             taskEdit.setupTaskField(edit,
                                     true,
                                     calGetString("calendar", "taskEditInstructionsReadonly"));
-        } else {
-            edit.showsInstructions = false;
-            taskEdit.setupTaskField(edit, false, edit.savedValue || "");
         }
     },
 
     /**
      * Handler function to call when the quick-add textbox loses focus.
      *
      * @param aEvent    The DOM blur event
      */
-    onBlur: function tE_onBlur(aEvent) {
+    onBlur: function(aEvent) {
         let edit = aEvent.target;
         if (edit.localName == "input") {
             // For some reason, we only receive the blur event for the input
             // element. There are no targets that point to the textbox. Go up
             // the parent chain until we reach the textbox.
             edit = edit.parentNode.parentNode;
         }
 
         let calendar = getSelectedCalendar();
         if (!calendar) {
             // this must be a first run, we don't have a calendar yet
             return;
         }
 
-        if (calendar.getProperty("capabilities.tasks.supported") === false){
+        if (calendar.getProperty("capabilities.tasks.supported") === false) {
             taskEdit.setupTaskField(edit,
                                     true,
                                     calGetString("calendar", "taskEditInstructionsCapability"));
-        } else if (!isCalendarWritable(calendar)) {
-            taskEdit.setupTaskField(edit,
-                                    true,
-                                    calGetString("calendar", "taskEditInstructionsReadonly"));
-        } else {
+        } else if (isCalendarWritable(calendar)) {
             if (!edit.showsInstructions) {
                 edit.savedValue = edit.value || "";
             }
             taskEdit.setupTaskField(edit,
                                     false,
                                     calGetString("calendar", "taskEditInstructions"));
+        } else {
+            taskEdit.setupTaskField(edit,
+                                    true,
+                                    calGetString("calendar", "taskEditInstructionsReadonly"));
         }
         edit.showsInstructions = true;
     },
 
     /**
      * Handler function to call on keypress for the quick-add textbox.
      *
      * @param aEvent    The DOM keypress event
      */
-    onKeyPress: function tE_onKeyPress(aEvent) {
+    onKeyPress: function(aEvent) {
         if (aEvent.keyCode == Components.interfaces.nsIDOMKeyEvent.DOM_VK_RETURN) {
             let edit = aEvent.target;
             if (edit.value && edit.value.length > 0) {
                 let item = cal.createTodo();
                 setDefaultItemValues(item);
                 item.title = edit.value;
 
                 edit.value = "";
                 setCustomCalendarDefaultsTaskQuickadd(item);
-                doTransaction('add', item, item.calendar, null, null);
+                doTransaction("add", item, item.calendar, null, null);
             }
         }
     },
 
     /**
      * Window load function to set up all quick-add textboxes. The texbox must
      * have the class "task-edit-field".
      */
-    onLoad: function tE_onLoad(aEvent) {
+    onLoad: function(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();
     },
 
     /**
      * Window load function to clean up all quick-add fields.
      */
-    onUnload: function tE_onUnload() {
+    onUnload: function() {
         getCompositeCalendar().removeObserver(taskEdit.compositeObserver);
         taskEdit.observedCalendar = null;
     },
 
     /**
      * Observer to watch for readonly, disabled and capability changes of the
      * observed calendar.
      *
@@ -354,37 +352,35 @@ var ccdTaskEdit = {
         onStartBatch: function() {},
         onEndBatch: function() {},
         onLoad: function(aCalendar) {},
         onAddItem: function(aItem) {},
         onModifyItem: function(aNewItem, aOldItem) {},
         onDeleteItem: function(aDeletedItem) {},
         onError: function(aCalendar, aErrNo, aMessage) {},
 
-        onPropertyChanged: function tE_calObs_onPropertyChanged(aCalendar,
-                                                         aName,
-                                                         aValue,
-                                                         aOldValue) {
+        onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {
             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++) {
+                case "disabled": {
+                    let taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+                    for (let i = 0; i < taskEditFields.length; i++) {
                         taskEdit.onBlur({ target: taskEditFields[i] });
                     }
+                    break;
+                }
             }
         },
 
-        onPropertyDeleting: function tE_calObs_onPropertyDeleting(aCalendar,
-                                                           aName) {
+        onPropertyDeleting: function(aCalendar, aName) {
             // Since the old value is not used directly in onPropertyChanged,
             // but should not be the same as the value, set it to a different
             // value.
             this.onPropertyChanged(aCalendar, aName, null, null);
         }
     },
 
     /**
@@ -407,21 +403,21 @@ var ccdTaskEdit = {
         onAddItem: function(aItem) {},
         onModifyItem: function(aNewItem, aOldItem) {},
         onDeleteItem: function(aDeletedItem) {},
         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++) {
+        onCalendarAdded: function(aCalendar) {},
+        onCalendarRemoved: function(aCalendar) {},
+        onDefaultCalendarChanged: function(aNewDefault) {
+            let taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+            for (let i = 0; i < taskEditFields.length; i++) {
                 taskEdit.onBlur({ target: taskEditFields[i] });
             }
             taskEdit.observedCalendar = aNewDefault;
         }
     }
 };
 
 /**
@@ -436,37 +432,35 @@ var ccdCalendarViewController = {
 
         return this;
     },
 
     /**
      * Creates a new event
      * @see calICalendarViewController
      */
-    createNewEvent: function (aCalendar, aStartTime, aEndTime, aForceAllday) {
+    createNewEvent: function(aCalendar, aStartTime, aEndTime, aForceAllday) {
         aCalendar = aCalendar || getSelectedCalendar();
-
-
         // if we're given both times, skip the dialog
         if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {
             let item = cal.createEvent();
             setDefaultItemValues(item, aCalendar, aStartTime, aEndTime);
             item.title = calGetString("calendar", "newEvent");
             setCustomCalendarDefaultsEventDrag(item);
-            doTransaction('add', item, item.calendar, null, null);
+            doTransaction("add", item, item.calendar, null, null);
         } else {
             createEventWithDialog(aCalendar, aStartTime, null, null, null, aForceAllday);
         }
     },
 
     /**
      * Modifies the given occurrence
      * @see calICalendarViewController
      */
-    modifyOccurrence: function (aOccurrence, aNewStartTime, aNewEndTime, aNewTitle) {
+    modifyOccurrence: function(aOccurrence, aNewStartTime, aNewEndTime, aNewTitle) {
         // if modifying this item directly (e.g. just dragged to new time),
         // then do so; otherwise pop up the dialog
         if (aNewStartTime || aNewEndTime || aNewTitle) {
             let instance = aOccurrence.clone();
 
             if (aNewTitle) {
                 instance.title = aNewTitle;
             }
@@ -491,90 +485,93 @@ var ccdCalendarViewController = {
                         instance.entryDate = aNewStartTime;
                     }
                     if (aNewEndTime && instance.dueDate) {
                         instance.dueDate = aNewEndTime;
                     }
                 }
             }
 
-            doTransaction('modify', instance, instance.calendar, aOccurrence, null);
+            doTransaction("modify", instance, instance.calendar, aOccurrence, null);
         } else {
             modifyEventWithDialog(aOccurrence, null, true);
         }
     },
 
     /**
      * Deletes the given occurrences
      * @see calICalendarViewController
      */
-    deleteOccurrences: function (aCount,
-                                 aOccurrences,
-                                 aUseParentItems,
-                                 aDoNotConfirm) {
+    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(item => isCalendarWritable(item.calendar));
 
-        for each (var itemToDelete in occurrences) {
+        for (let itemToDelete of occurrences) {
             if (aUseParentItems) {
                 // Usually happens when ctrl-click is used. In that case we
                 // don't need to ask the user if he wants to delete an
                 // occurrence or not.
                 itemToDelete = itemToDelete.parentItem;
             } else if (!aDoNotConfirm && occurrences.length == 1) {
                 // Only give the user the selection if only one occurrence is
                 // selected. Otherwise he will get a dialog for each occurrence
                 // he deletes.
-                var [itemToDelete, hasFutureItem, response] = promptOccurrenceModification(itemToDelete, false, "delete");
+                let [targetItem, , response] = promptOccurrenceModification(itemToDelete, false, "delete");
                 if (!response) {
                     // The user canceled the dialog, bail out
                     break;
                 }
+
+                itemToDelete = targetItem;
             }
 
             // Now some dirty work: Make sure more than one occurrence can be
             // deleted by saving the recurring items and removing occurrences as
             // they come in. If this is not an occurrence, we can go ahead and
             // delete the whole item.
-            if (itemToDelete.parentItem.hashId != itemToDelete.hashId) {
-                var savedItem = getSavedItem(itemToDelete);
+            if (itemToDelete.parentItem.hashId == itemToDelete.hashId) {
+                doTransaction("delete", itemToDelete, itemToDelete.calendar, null, null);
+            } else {
+                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 each (var ritem in recurringItems) {
-            doTransaction('modify',
+        for (let hashVal in recurringItems) {
+            let ritem = recurringItems[hashVal];
+            doTransaction("modify",
                           ritem.newItem,
                           ritem.newItem.calendar,
                           ritem.oldItem,
                           null);
         }
         endBatchTransaction();
     }
 };
diff -u8pdNr 1.6/install.rdf 1.7/install.rdf
--- 1.6/install.rdf	2015-08-04 19:35:27.360658900 +0200
+++ 1.7/install.rdf	2017-04-28 21:13:24.860355600 +0200
@@ -4,17 +4,17 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
 
   <Description about="urn:mozilla:install-manifest">
     <em:name>Custom Calendar Defaults</em:name>
     <em:id>customcalendardefaults@nadelundhirn.de</em:id>
-    <em:version>1.6</em:version>
+    <em:version>1.7</em:version>
 
     <em:localized>
       <Description>
         <em:locale>de-DE</em:locale>
         <em:name>Custom Calendar Defaults</em:name>
         <em:creator>Robert Brand</em:creator>
         <em:description>Voreinstellungen für Termine und Aufgaben anpassen</em:description>
         <em:homepageURL>http://www.nadelundhirn.de/wp/tag/custom-calendar-defaults/</em:homepageURL>
@@ -27,33 +27,33 @@
 	<em:updateURL>http://www.nadelundhirn.de/krams/exten/customcalendardefaults/update.rdf</em:updateURL>
 	<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0aEUGwdymA73OVxwnZK4y6GkkP6t260QkoOOE1v+SoSC4bz8Xjqdmgb9Bs0YZNqQrB1VlvkMoAF3mnf5h/8vd2s43VverhrqXBxYehZmFiwL11f84vwPV5HsRfTwFlSgAOufY/d7/6DOoZkbhXR2/0QMxkscWtbIK0NpCZ3FCEQIDAQAB</em:updateKey>
 
     <!-- Thunderbird -->
     <em:targetApplication>
       <Description>
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
         <em:minVersion>38.0a1</em:minVersion>
-        <em:maxVersion>38.*</em:maxVersion>
+        <em:maxVersion>52.*</em:maxVersion>
       </Description>
     </em:targetApplication>
     
     <!-- SeaMonkey -->
     <em:targetApplication>
       <Description>
         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
-        <em:minVersion>2.35</em:minVersion>
-        <em:maxVersion>2.35.*</em:maxVersion>
+        <em:minVersion>2.49</em:minVersion>
+        <em:maxVersion>2.49.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
     <em:requires>
       <Description>
         <!-- Lightning (also Sunbird via extension stub) -->
         <em:id>{e2fda1a4-762b-4020-b5ad-a41df1933103}</em:id>
-        <em:minVersion>4.0</em:minVersion>
-        <em:maxVersion>4.0.*</em:maxVersion>
+        <em:minVersion>5.4</em:minVersion>
+        <em:maxVersion>5.4.*</em:maxVersion>
       </Description>
     </em:requires>
 
   </Description>
 
 </RDF>
