farhoudshapouran / react-native-ui-datepicker

Customizable React Native 📅 DatePicker component for Android, iOS, and Web. It includes single, range and multiple modes and supports different locales.
https://farhoudshapouran.github.io/react-native-ui-datepicker/
MIT License
272 stars 28 forks source link

Can't change the locale #84

Closed poupsipoups closed 2 months ago

poupsipoups commented 2 months ago

I tried to change the locale in 'fr' and 'es' but nothing change. I also tried different format like 'FR', 'fr_FR' but nothing works. I went to check the demo here : https://farhoudshapouran.github.io/react-native-ui-datepicker/ and event here when we click on locale buttons it doesn't change the language.

Have someone the same mistake ?

<DateTimePicker
                    mode="single"
                    locale="fr"
                    firstDayOfWeek={1}
                    date={birthDate}
                    onChange={(response) => {
                      setBirthDate(new Date(response.date.toString()))
                      toggleDatePicker()
                    }}
                    selectedItemColor={colors.mainColors.mainColor}
/>
timotismjntk commented 2 months ago

add this on top, require('dayjs/locale/fr');

poupsipoups commented 2 months ago

thank you ! 😃