Skip to content

Set locale for dates formatting globally #224

Closed Answered by sergiodxa
cjoecker asked this question in Q&A
Discussion options

You must be logged in to vote

You could do it in your loaders, but note that unless you're 100% sure every request will create a new instance of your server app, your server may be shared between users with different locales, so setting something like this globally will most likely cause issues.

I recommend you to set it on every place you need it or use something like AsyncLocalStorage to make it available to nested code.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sergiodxa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants