Make the dates shown in the Expired Certificate alert have consistent (short) format. Bug 246905, patch by Constantine A. Murenin <cnst+bmo@bugmail.mojo.ru>, r=jgmyers, sr=brendan

This commit is contained in:
smontagu%smontagu.org 2005-09-29 08:41:22 +00:00
Родитель 6d9ff886f2
Коммит 159e0a2eab
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -55,9 +55,15 @@ function onLoad()
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = dialogParams.GetString(1);
var currDate = new Date();
const nsIScriptableDateFormat = Components.interfaces.nsIScriptableDateFormat;
var dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].getService(nsIScriptableDateFormat);
var date = new Date();
var dateStr = dateService.FormatDateTime("", dateService.dateFormatShort, dateService.timeFormatNoSeconds,
date.getFullYear(), date.getMonth()+1, date.getDate(),
date.getHours(), date.getMinutes(), date.getSeconds());
var message2 = bundle.formatStringFromName("serverCertExpiredMsg2",
[ currDate.toLocaleString() ],
[ dateStr ],
1);
setText("message1", message1);
setText("message2", message2);