Explicitly set locale to avoid hydration mismatch

Some functions in luxon default to the system's locale while other
functions default to "en-US".  Explicitly set the locale everywhere
the luxon objects are created to avoid possible mismatches and
unexpected behaviour should the system's locale be different.
This commit is contained in:
Hornwitser 2025-05-25 23:32:50 +02:00
parent e722876aae
commit ed67982ec0
5 changed files with 31 additions and 31 deletions

View file

@ -26,7 +26,7 @@ export default defineEventHandler(async (event) => {
});
}
if (body.timezone.length) {
const zonedTime = DateTime.local().setZone(body.timezone);
const zonedTime = DateTime.local({ locale: "en-US" }).setZone(body.timezone);
if (!zonedTime.isValid) {
throw createError({
status: 400,