Reading Client's timezone from React Server Components #71247
Unanswered
adheepgeorgepaul
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to make a few API calls, and these calls require passing timezone information. I am making these API calls from server components, but if I try to retrieve the timezone from the server, it will return the server's timezone. However, I need to use the client's timezone in the API calls. How can I solve this?
After reading several articles, I found that the x-timezone header can be used to pass timezone information in network requests. However, since the client's timezone can only be detected after the page has loaded in the browser, how can I capture and include the client's timezone in subsequent requests, so that the server can read the header and use it in the API calls?
Beta Was this translation helpful? Give feedback.
All reactions