fix: localize date formatting

This commit is contained in:
Your Name
2025-10-13 22:49:50 -06:00
parent d58c0723b1
commit b7f3837b1e

8
app.js
View File

@@ -13,6 +13,8 @@ const POPULAR_NAMES = [
const timezoneByName = new Map(SORTED_TIMEZONE_DATA.map((entry) => [entry.name, entry]));
const LOCALE = 'de-DE';
function normalizeText(value) {
return value
.toLowerCase()
@@ -80,7 +82,7 @@ function resolveInitialTheme() {
}
function buildLocalLabel(timeZone) {
const formatter = Intl.DateTimeFormat(undefined, {
const formatter = Intl.DateTimeFormat(LOCALE, {
timeZone,
timeZoneName: 'longGeneric'
});
@@ -95,7 +97,7 @@ function buildLocalLabel(timeZone) {
}
function formatClockValue(date, timeZone) {
return new Intl.DateTimeFormat(undefined, {
return new Intl.DateTimeFormat(LOCALE, {
timeZone,
hour: '2-digit',
minute: '2-digit',
@@ -105,7 +107,7 @@ function formatClockValue(date, timeZone) {
}
function formatDateValue(date, timeZone) {
return new Intl.DateTimeFormat(undefined, {
return new Intl.DateTimeFormat(LOCALE, {
timeZone,
weekday: 'long',
year: 'numeric',