Skip to content

Commit

Permalink
Change how we handle l10n-args for dates in the DocumentProperties di…
Browse files Browse the repository at this point in the history
…alog (bug 1922618)

Strangely enough the code works just fine as-is in the GENERIC viewer, so there must be some difference between the Firefox built-in Fluent implementation and the Fluent.js one.

It seems that we can work-around the problem by handling this l10n-arg the same way that we handle dates in the AnnotationLayer, and testing this with the Firefox Devtools it seems that it should work.
  • Loading branch information
Snuffleupagus committed Oct 4, 2024
1 parent e5b6144 commit c681ff2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/pdf_document_properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ class PDFDocumentProperties {
async #parseDate(inputDate) {
const dateObj = PDFDateString.toDateObject(inputDate);
return dateObj
? this.l10n.get("pdfjs-document-properties-date-time-string", { dateObj })
? this.l10n.get("pdfjs-document-properties-date-time-string", {
dateObj: dateObj.valueOf(),
})
: undefined;
}

Expand Down

0 comments on commit c681ff2

Please sign in to comment.