Bug 1478572 - backport bug fix in abCard.js detected by linting on trunk. r+a=me BETA_60_CONTINUATION
authorJorg K <jorgk@jorgk.com>
Sat, 01 Sep 2018 10:27:58 +0200
branchBETA_60_CONTINUATION
changeset 32458 9c11a5d238e1
parent 32457 b8fb9bf3792f
child 32459 370e9fd8b362
push id385
push userclokep@gmail.com
push dateTue, 04 Sep 2018 23:26:14 +0000
bugs1478572
Bug 1478572 - backport bug fix in abCard.js detected by linting on trunk. r+a=me
mail/components/addrbook/content/abCard.js
--- a/mail/components/addrbook/content/abCard.js
+++ b/mail/components/addrbook/content/abCard.js
@@ -844,16 +844,17 @@ function modifyDatepicker(aDatepicker) {
     if (aNoWrap && aField == this.monthField)
       aValue--;
     // make sure the date is valid for the given month
     if (aField == this.dateField) {
       var currentMonth = this.month;
       var dt = new Date(this.year, currentMonth, aValue);
       return dt.getMonth() != currentMonth ? 1 : aValue;
     }
+    var min = (aField == this.monthField) ? 0 : 1;
     var max = (aField == this.monthField) ? 11 : kMaxYear;
     // make sure the value isn't too high
     if (aValue > max)
       return aNoWrap ? max : min;
     return aValue;
   }
   // sets the specified field to the given value, but allows blank fields
   // from: mozilla/toolkit/content/widgets/datetimepicker.xml#698