You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: suppose a user normally lives in California, but is traveling to New York. Their laptop system automatically adjusts to ET, but the user wants to continue to view their datetimes in my app using their preferred timezone, which in this case is PT.
Using the DatePicker, I want to custom format the date and time components so that the displayed values are converted to PT in this case. How to do that? I do have the userLocale (en-US) and usertimezone (US/Pacific).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Scenario: suppose a user normally lives in California, but is traveling to New York. Their laptop system automatically adjusts to ET, but the user wants to continue to view their datetimes in my app using their preferred timezone, which in this case is PT.
Using the DatePicker, I want to custom format the date and time components so that the displayed values are converted to PT in this case. How to do that? I do have the userLocale (en-US) and usertimezone (US/Pacific).
I have seen this: https://date-fns.org/v3.3.1/docs/Time-Zones but I am not sure if DatePicker uses this internally or if it would help in this case.
It seems like to make this work for display, I would need a new DatePicker attribute, something like this:
I did see the utcOffset attribute here: https://github.com/Hacker0x01/react-datepicker/blob/main/docs/datepicker.md, but it doesn't seem to do anything if I pass "-07:00".
Beta Was this translation helpful? Give feedback.
All reactions