Bug 1512808 - fix date format detection in initLocaleShortDateFormat(). r+a=jorgk
authoraceman <acelists@atlas.sk>
Sat, 08 Dec 2018 14:57:00 +0100
changeset 31977 321076459c7e7d81d4fdcff7284ebcc0fc53e272
parent 31976 f520e6a3bb4350297d2c14a725f86f416db26c84
child 31978 dd636f3ec3fe47f418d1c94897409ddf30c63548
push id119
push usermozilla@jorgk.com
push dateSun, 09 Dec 2018 08:45:48 +0000
treeherdercomm-esr60@321076459c7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1512808
Bug 1512808 - fix date format detection in initLocaleShortDateFormat(). r+a=jorgk
mailnews/base/content/dateFormat.js
--- a/mailnews/base/content/dateFormat.js
+++ b/mailnews/base/content/dateFormat.js
@@ -20,17 +20,17 @@ function initLocaleShortDateFormat()
   gSearchDateFormat = 3;
   gSearchDateSeparator = "/";
   gSearchDateLeadingZeros = true;
 
   try {
     const dateFormatter = new Services.intl.DateTimeFormat(undefined,
       { dateStyle: "short" });
     var aDate = new Date(1999, 11, 1);
-    var dateString = dateFormatter.format(aDate);
+    var dateString = dateFormatter.format(aDate).replace(/ /g,"");
 
     // find out the separator
     var possibleSeparators = "/-.";
     var arrayOfStrings;
     for ( var i = 0; i < possibleSeparators.length; ++i )
     {
       arrayOfStrings = dateString.split( possibleSeparators[i] );
       if ( arrayOfStrings.length == 3 )