mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Issue #1694 - Part 2: Use scriptabledateformat for Update History display.
This commit is contained in:
parent
b6354a7a37
commit
ec96755589
1 changed files with 11 additions and 6 deletions
|
|
@ -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());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue