Bug 443811 - Use long date format for cert date output. r=keeler

This commit is contained in:
Cykesiopka 2015-08-12 00:30:00 -04:00
Родитель 8e93c098d1
Коммит 0ecb2989e8
3 изменённых файлов: 24 добавлений и 19 удалений

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

@ -838,12 +838,10 @@ GetDateBoundary(nsIX509Cert* ix509,
if (NS_FAILED(rv))
return;
dateTimeFormat->FormatPRTime(nullptr, kDateFormatShort,
kTimeFormatNoSeconds, timeToUse,
formattedDate);
dateTimeFormat->FormatPRTime(nullptr, kDateFormatShort,
kTimeFormatNoSeconds, now,
nowDate);
dateTimeFormat->FormatPRTime(nullptr, kDateFormatLong, kTimeFormatNoSeconds,
timeToUse, formattedDate);
dateTimeFormat->FormatPRTime(nullptr, kDateFormatLong, kTimeFormatNoSeconds,
now, nowDate);
}
static void

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

@ -1658,14 +1658,15 @@ ProcessSECAlgorithmID(SECAlgorithmID *algID,
}
static nsresult
ProcessTime(PRTime dispTime, const char16_t *displayName,
nsIASN1Sequence *parentSequence)
ProcessTime(PRTime dispTime, const char16_t* displayName,
nsIASN1Sequence* parentSequence)
{
nsresult rv;
nsCOMPtr<nsIDateTimeFormat> dateFormatter =
do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &rv);
if (NS_FAILED(rv))
if (NS_FAILED(rv)) {
return rv;
}
nsString text;
nsString tempString;
@ -1673,8 +1674,9 @@ ProcessTime(PRTime dispTime, const char16_t *displayName,
PRExplodedTime explodedTime;
PR_ExplodeTime(dispTime, PR_LocalTimeParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatSecondsForce24Hour,
&explodedTime, tempString);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong,
kTimeFormatSecondsForce24Hour,
&explodedTime, tempString);
text.Append(tempString);
text.AppendLiteral("\n(");
@ -1682,8 +1684,9 @@ ProcessTime(PRTime dispTime, const char16_t *displayName,
PRExplodedTime explodedTimeGMT;
PR_ExplodeTime(dispTime, PR_GMTParameters, &explodedTimeGMT);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatSecondsForce24Hour,
&explodedTimeGMT, tempString);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong,
kTimeFormatSecondsForce24Hour,
&explodedTimeGMT, tempString);
text.Append(tempString);
text.AppendLiteral(" GMT)");

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

@ -60,7 +60,8 @@ NS_IMETHODIMP nsX509CertValidity::GetNotBeforeLocalTime(nsAString &aNotBeforeLoc
nsAutoString date;
PRExplodedTime explodedTime;
PR_ExplodeTime(mNotBefore, PR_LocalTimeParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatSecondsForce24Hour,
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong,
kTimeFormatSecondsForce24Hour,
&explodedTime, date);
aNotBeforeLocalTime = date;
return NS_OK;
@ -79,7 +80,7 @@ NS_IMETHODIMP nsX509CertValidity::GetNotBeforeLocalDay(nsAString &aNotBeforeLoca
nsAutoString date;
PRExplodedTime explodedTime;
PR_ExplodeTime(mNotBefore, PR_LocalTimeParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatNone,
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong, kTimeFormatNone,
&explodedTime, date);
aNotBeforeLocalDay = date;
return NS_OK;
@ -99,7 +100,8 @@ NS_IMETHODIMP nsX509CertValidity::GetNotBeforeGMT(nsAString &aNotBeforeGMT)
nsAutoString date;
PRExplodedTime explodedTime;
PR_ExplodeTime(mNotBefore, PR_GMTParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatSecondsForce24Hour,
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong,
kTimeFormatSecondsForce24Hour,
&explodedTime, date);
aNotBeforeGMT = date;
return NS_OK;
@ -130,7 +132,8 @@ NS_IMETHODIMP nsX509CertValidity::GetNotAfterLocalTime(nsAString &aNotAfterLocal
nsAutoString date;
PRExplodedTime explodedTime;
PR_ExplodeTime(mNotAfter, PR_LocalTimeParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatSecondsForce24Hour,
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong,
kTimeFormatSecondsForce24Hour,
&explodedTime, date);
aNotAfterLocaltime = date;
return NS_OK;
@ -149,7 +152,7 @@ NS_IMETHODIMP nsX509CertValidity::GetNotAfterLocalDay(nsAString &aNotAfterLocalD
nsAutoString date;
PRExplodedTime explodedTime;
PR_ExplodeTime(mNotAfter, PR_LocalTimeParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatNone,
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong, kTimeFormatNone,
&explodedTime, date);
aNotAfterLocalDay = date;
return NS_OK;
@ -168,7 +171,8 @@ NS_IMETHODIMP nsX509CertValidity::GetNotAfterGMT(nsAString &aNotAfterGMT)
nsAutoString date;
PRExplodedTime explodedTime;
PR_ExplodeTime(mNotAfter, PR_GMTParameters, &explodedTime);
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatShort, kTimeFormatSecondsForce24Hour,
dateFormatter->FormatPRExplodedTime(nullptr, kDateFormatLong,
kTimeFormatSecondsForce24Hour,
&explodedTime, date);
aNotAfterGMT = date;
return NS_OK;