Add basic date & time formatters using navigator language (#404)
Adjacent to #400 — while this isn't yet a proper localization pass, at least dates & times will now use the user's browser language/locale settings. When used in Browsertrix, this should ensure dates are formatted more consistently, at least when the user has a locale with a language matching one of the supported languages in Browsertrix set in their browser settings. Also adds tabular numerals in a few places (e.g. lists of dates/times).
This commit is contained in:
@@ -8,6 +8,7 @@ import fasSearch from "@fortawesome/fontawesome-free/svgs/solid/search.svg";
|
||||
import "keyword-mark-element/lib/keyword-mark.js";
|
||||
import { type ItemType } from "./types";
|
||||
import { type URLResource } from "./types";
|
||||
import { dateTimeFormatter } from "./utils/dateTimeFormatter";
|
||||
|
||||
// ===========================================================================
|
||||
/**
|
||||
@@ -544,7 +545,7 @@ class URLResources extends LitElement {
|
||||
</td>
|
||||
<td class="column col-ts is-2">
|
||||
<p class="minihead is-hidden-tablet">Date</p>
|
||||
${new Date(result.date).toLocaleString()}
|
||||
${dateTimeFormatter.format(new Date(result.date))}
|
||||
</td>
|
||||
<td class="column col-mime is-3">
|
||||
<p class="minihead is-hidden-tablet">Media Type</p>
|
||||
|
||||
Reference in New Issue
Block a user