diff --git a/Dockerfile b/Dockerfile index 7f94dc5..ff60305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,7 +51,7 @@ FROM ${NODE_VERSION} RUN apk add --no-cache tzdata ENV TZ=Europe/Prague \ - LANG=cs_CZ.UTF-8 \ + LC_ALL=cs_CZ.UTF-8 \ NODE_ENV=production WORKDIR /app diff --git a/Dockerfile-Woodpecker b/Dockerfile-Woodpecker index 6d57a41..6291b32 100644 --- a/Dockerfile-Woodpecker +++ b/Dockerfile-Woodpecker @@ -4,7 +4,7 @@ FROM ${NODE_VERSION} RUN apk add --no-cache tzdata ENV TZ=Europe/Prague \ - LANG=cs_CZ.UTF-8 \ + LC_ALL=cs_CZ.UTF-8 \ NODE_ENV=production WORKDIR /app diff --git a/server/src/utils.ts b/server/src/utils.ts index e8e8e35..aadacba 100644 --- a/server/src/utils.ts +++ b/server/src/utils.ts @@ -1,5 +1,7 @@ import { Choices, LocationKey } from "../../types"; +const DAY_OF_WEEK_FORMAT = new Intl.DateTimeFormat(undefined, {weekday: 'long'}); + /** Vrátí datum v ISO formátu. */ export function formatDate(date: Date, format?: string) { let day = String(date.getDate()).padStart(2, '0'); @@ -15,7 +17,7 @@ export function getHumanDate(date: Date) { let currentDay = String(date.getDate()).padStart(2, '0'); let currentMonth = String(date.getMonth() + 1).padStart(2, "0"); let currentYear = date.getFullYear(); - let currentDayOfWeek = date.toLocaleDateString("CZ-cs", { weekday: 'long' }); + let currentDayOfWeek = DAY_OF_WEEK_FORMAT.format(date); return `${currentDay}.${currentMonth}.${currentYear} (${currentDayOfWeek})`; }