Backed out changeset 1f0cb7f8dc0b (bug 1503731) for test failures. a=backout
authorJorg K <jorgk@jorgk.com>
Thu, 20 Dec 2018 19:11:22 +0100
changeset 33893 fe6b4b76613f02e23c4773e110a354ea072edbcf
parent 33892 ea62abed1629265310efdd303e24186a7239dbd0
child 33894 60a1cefdf2afe240abc3558542a8237276e7f000
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersbackout
bugs1503731
backs out1f0cb7f8dc0bf68efab5f02b3b77822210b73090
Backed out changeset 1f0cb7f8dc0b (bug 1503731) for test failures. 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);