Backed out changeset 66eedcaff9fa (bug 1503731) for test failures on Mac. a=backout
authorJorg K <jorgk@jorgk.com>
Thu, 20 Dec 2018 20:14:15 +0100
changeset 34038 d2d18de2ec8571ec04a247b7f7096179328e4d6f
parent 34037 f9cf0cecc60cffd6662bd59bd2feafe56a6522d9
child 34039 1481cb94d41e940d40ea97e8825d8b37d154e406
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersbackout
bugs1503731
backs out66eedcaff9fac89a318dd866d42b3777e32e58c4
Backed out changeset 66eedcaff9fa (bug 1503731) for test failures on Mac. a=backout
calendar/resources/content/datetimepickers/datetimepickers.xml
--- a/calendar/resources/content/datetimepickers/datetimepickers.xml
+++ b/calendar/resources/content/datetimepickers/datetimepickers.xml
@@ -1661,21 +1661,18 @@
             this.alphaMonths = null;
             this.probeSucceeded = false;
             this.mLastDateParseIncludedTime = false;
 
             // SHORT NUMERIC DATE, such as 2002-03-04, 4/3/2002, or CE2002Y03M04D.
             // Made of digits & nonDigits.  (Nondigits may be unicode letters
             // which do not match \w, esp. in CJK locales.)
             this.parseShortDateRegex = /^\D*(\d+)\D+(\d+)\D+(\d+)\D?$/;
-            // Make sure to use UTC date and timezone here to avoid the pattern
-            // detection to fail if the probe date output would have an timezone
-            // offset due to our lack of support of historic timezone definitions.
-            let probeDate = new Date(Date.UTC(2002, 2, 4)); // month is 0-based
-            let probeString = this.formatDate(probeDate, cal.dtz.utc);
+            let probeDate = new Date(2002, 2, 4); // month is 0-based
+            let probeString = this.formatDate(probeDate);
             let probeArray = this.parseShortDateRegex.exec(probeString);
             if (probeArray) {
                 // Numeric month format
                 for (let i = 1; i <= 3; i++) {
                     switch (Number(probeArray[i])) {
                         case 2: this.twoDigitYear = true; // falls through
                         case 2002: this.yearIndex = i; break;
                         case 3: this.monthIndex = i; break;
@@ -1834,24 +1831,18 @@
                 new RegExp("(" + ampmExpr + ")?\\s?" + digitsExpr + "(" + ampmExpr + ")?\\s*$");
             this.amRegExp = new RegExp("^(?:" + amExpr + ")$");
             this.pmRegExp = new RegExp("^(?:" + pmExpr + ")$");
         ]]></body>
       </method>
 
       <method name="formatDate">
         <parameter name="aDate"/>
-        <parameter name="aTimezone"/>
         <body><![CDATA[
-            // Usually, floating is ok here, so no need to pass aTimezone - we just need to pass
-            // it in if we need to make sure formatting happens without a timezone conversion.
-            let timezone = aTimezone || cal.dtz.floating;
-            return cal.getDateFormatter().formatDateShort(
-                cal.dtz.jsDateToDateTime(aDate, timezone)
-            );
+            return cal.getDateFormatter().formatDateShort(cal.dtz.jsDateToDateTime(aDate, cal.dtz.floating));
         ]]></body>
       </method>
 
       <method name="formatTime">
         <parameter name="aValue"/>
         <body><![CDATA[
             let formatter = new Services.intl.DateTimeFormat(undefined, this.kTimeFormatObject);
             return formatter.format(aValue);