summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-12-04 16:41:24 +0000
committerMoonchild <moonchild@palemoon.org>2020-12-04 16:41:24 +0000
commit6cb00e2cfd2630877e947ab8266497672df306d0 (patch)
treefd9e368e412e081dffa99a684cc50454c29791ed /toolkit
parent16a1ff22a39550b11fb8d13e8d40aba0d973535b (diff)
downloaduxp-6cb00e2cfd2630877e947ab8266497672df306d0.tar.gz
Issue #1694 - Part 2: Use scriptabledateformat for Update History display.
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/mozapps/update/content/history.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/toolkit/mozapps/update/content/history.js b/toolkit/mozapps/update/content/history.js
index c5bbccefcf..809eee4782 100644
--- a/toolkit/mozapps/update/content/history.js
+++ b/toolkit/mozapps/update/content/history.js
@@ -58,13 +58,18 @@ var gUpdateHistory = {
* @returns A human readable date string
*/
_formatDate: function(seconds) {
+ var sdf =
+ Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
+ getService(Components.interfaces.nsIScriptableDateFormat);
var date = new Date(seconds);
- const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Components.interfaces.nsIXULChromeRegistry)
- .getSelectedLocale("global", true);
- const dtOptions = { year: 'numeric', month: 'long', day: 'numeric',
- hour: 'numeric', minute: 'numeric', second: 'numeric' };
- return date.toLocaleString(locale, dtOptions);
+ return sdf.FormatDateTime("", sdf.dateFormatLong,
+ sdf.timeFormatSeconds,
+ date.getFullYear(),
+ date.getMonth() + 1,
+ date.getDate(),
+ date.getHours(),
+ date.getMinutes(),
+ date.getSeconds());
}
};