Bug 1428282 - Replace obsolete toLocaleFormat for SeaMonkey archive folder name generation. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Tue, 15 May 2018 21:32:58 +0200
changeset 31480 9797b9e8b49b261c11e45aaf562dc1d05713a18c
parent 31479 a4ba53cf58acfd2d9dd37fd26b1ef1b5f009deb6
child 31481 8b63ca94fb25e3b48f1580e01b33ba436440e3c0
push id5
push userfrgrahl@gmx.net
push dateTue, 15 May 2018 19:34:09 +0000
treeherdercomm-esr60@9797b9e8b49b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1428282, 1356272
Bug 1428282 - Replace obsolete toLocaleFormat for SeaMonkey archive folder name generation. r=IanN a=IanN See Thunderbird Bug 1356272 [Monthly archive folders should always have two-digit month to keep folders sorted].
suite/mailnews/mailWindowOverlay.js
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -1124,17 +1124,17 @@ BatchMessageMover.prototype =
     gNextMessageViewIndexAfterDelete = -2;
 
     for (let i = 0; i < aMsgHdrs.length; ++i)
     {
       let msgHdr = aMsgHdrs[i];
       let server = msgHdr.folder.server;
       let msgDate = new Date(msgHdr.date / 1000);  // convert date to JS date object
       let msgYear = msgDate.getFullYear().toString();
-      let monthFolderName = msgDate.toLocaleFormat("%Y-%m");
+      let monthFolderName = msgYear + "-" + (msgDate.getMonth() + 1).toString().padStart(2, "0");
 
       let archiveFolderUri;
       let archiveGranularity;
       let archiveKeepFolderStructure;
       if (server.type == "rss") {
         // RSS servers don't have an identity so we special case the archives URI.
         archiveFolderUri = server.serverURI + "/Archives";
         archiveGranularity =