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:
parent
e722876aae
commit
ed67982ec0
5 changed files with 31 additions and 31 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue