Commit fe51fcb5 authored by Alex Danilo's avatar Alex Danilo Committed by Commit Bot

Use correct locale for date and time formatting

Dates and times should be formatted according to the correct locale and
language.

Changes the instantiation of Intl.DateTimeFormat to use the current
language version.

Bug: 1076309
Change-Id: I27793a379899b8d1d1e3734d72b849436de62909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404228
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806077}
parent 72cbf0c3
...@@ -23,9 +23,9 @@ class FileMetadataFormatter extends cr.EventTarget { ...@@ -23,9 +23,9 @@ class FileMetadataFormatter extends cr.EventTarget {
*/ */
setDateTimeFormat(use12hourClock) { setDateTimeFormat(use12hourClock) {
this.timeFormatter_ = new Intl.DateTimeFormat( this.timeFormatter_ = new Intl.DateTimeFormat(
[] /* default locale */, navigator.language,
{hour: 'numeric', minute: 'numeric', hour12: use12hourClock}); {hour: 'numeric', minute: 'numeric', hour12: use12hourClock});
this.dateFormatter_ = new Intl.DateTimeFormat([] /* default locale */, { this.dateFormatter_ = new Intl.DateTimeFormat(navigator.language, {
year: 'numeric', year: 'numeric',
month: 'short', month: 'short',
day: 'numeric', day: 'numeric',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment