Bug 1497352 - Port Bug 1428172 [Align mozIntl with Intl when working with constructors] to ChatZilla. r=gijs
authorBill Gianopoulos <wgianopoulos@gmail.com>
Tue, 27 Feb 2018 10:44:40 -0500
changeset 2127 ded1d42cc8ed
parent 2126 75c8c75015bc
child 2128 123b577e241f
push id522
push userfrgrahl@gmx.net
push dateSun, 14 Oct 2018 13:39:19 +0000
reviewersgijs
bugs1497352, 1428172
Bug 1497352 - Port Bug 1428172 [Align mozIntl with Intl when working with constructors] to ChatZilla. r=gijs
xul/content/static.js
--- a/xul/content/static.js
+++ b/xul/content/static.js
@@ -269,18 +269,24 @@ function initStatic()
                                           this.getFullYear(), this.getMonth() + 1,
                                           this.getDate(), this.getHours(),
                                           this.getMinutes(), this.getSeconds()
                                          );
             }
         }
         else
         {
-            client.dtFormatter = Services.intl.createDateTimeFormat(
-                undefined, { dateStyle: "full", timeStyle: "long" });
+            if (Services.vc.compare(Services.appinfo.platformVersion, "59.0") < 0) {
+                client.dtFormatter = Services.intl.createDateTimeFormat(
+                    undefined, { dateStyle: "full", timeStyle: "long" });
+            }
+            else {
+                client.dtFormatter = new Services.intl.DateTimeFormat(
+                    undefined, { dateStyle: "full", timeStyle: "long" });
+            }
 
             // Mmmm, fun. This ONLY affects the ChatZilla window, don't worry!
             Date.prototype.toStringInt = Date.prototype.toString;
             Date.prototype.toString = function() {
                 return client.dtFormatter.format(this);
             }
         }
     }