Is there a way to have a DateRangePicker (x-date-pickers-pro) use the browsers current locale for date format? #11240
Labels
component: pickers
This is the name of the generic UI component, not the React module!
status: waiting for author
Issue with insufficient information
support: commercial
Support request from paid users
The problem in depth 🔍
I have a Web-UI where I don't know which locale or what language the users may be using, so I would prefer to just use whatever language/locale is configured in the browser to format the dates.
This seems to be exactly how it works for dates shown in Data Grids.
However I have DateRangePicker which defaults to "en_US". Setting it to a specific locale works fine, but is there an easy way to just use the browsers current locale?
EDIT:
I should add, we are using date-fns for handling dates.
The code for creating the DateRangePicker:
Your environment 🌎
`npx @mui/envinfo`
Search keywords: daterangepicker locale
Order ID: 70895
The text was updated successfully, but these errors were encountered: