Bug 1346797 - Fix calendar eslint issues - Fix no-negated-condition issues. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Sun, 30 Jul 2017 13:37:59 +0200
changeset 29138 72d3386335959217ebe27c56b2b4d1c250763f3a
parent 29137 938e0676a3cd4e0b1af046d115d2f224bc87a749
child 29139 a63c88905470a752c7ff3316b7393234baa5c0e6
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1346797
Bug 1346797 - Fix calendar eslint issues - Fix no-negated-condition issues. r=MakeMyDay MozReview-Commit-ID: FE00hW0ToOd
calendar/base/content/widgets/minimonth.xml
--- a/calendar/base/content/widgets/minimonth.xml
+++ b/calendar/base/content/widgets/minimonth.xml
@@ -862,25 +862,25 @@
           }
           // Update the calendar
           let calbox = document.getAnonymousElementByAttribute(this, "anonid", "minimonth-calendar");
           let date = this._getStartDate(aDate);
 
           // get today's date
           let today = new Date();
 
-          if (aDate.getFullYear() != (this.mValue || this.mExtraDate).getFullYear()) {
+          if (aDate.getFullYear() == (this.mValue || this.mExtraDate).getFullYear()) {
+              calbox.setAttribute("aria-label", cal.calGetString("dateFormat",
+                                  "month." + (aDate.getMonth() + 1) + ".name"));
+          } else {
               let monthName = cal.formatMonth(aDate.getMonth() + 1,
                                               "calendar", "monthInYear");
               let label = cal.calGetString("calendar", "monthInYear",
                                        [monthName, aDate.getFullYear()]);
               calbox.setAttribute("aria-label", label);
-          } else {
-              calbox.setAttribute("aria-label", cal.calGetString("dateFormat",
-                                  "month." + (aDate.getMonth() + 1) + ".name"));
           }
 
           this.mDayMap = {};
           let defaultTz = cal.calendarDefaultTimezone();
           let dateFormatter =
               Services.intl.createDateTimeFormat(undefined, { dateStyle: "long" });
           for (let k = 1; k < 7; k++) {
               // Set the week number.