Tell us which versions you are using:
Hello,
how can I get the Month from the Datepicker in german?
Thanx
The datepicker that comes with the bootstrap templates (datepicker.android.js and datepicker.ios.js) uses the native components provided by React Native: DatePickerIOS and DatePickerAndroid.
DatePickerIOS is a wrapper around iOS' UIDatePicker. Despite the fact that UIDatePicker has locale attribute, this is not exposed in the current implementation of RN's DatePickerIOS (mode is the only attribute exposed).
DatePickerAndroid is a wrapper around Android's DatePickerDialog. There are some workarounds to change the language for the native component as explained here but they are not exposed by the RN's component.
So in other words, with the current implementation of the datepickers provided by RN (that tcomb-form-native relies on) there is no way to change the language, you're stuck with the system language 馃槙
You can look for other datepicker components with localization support and create a tcomb-form-native factory to use them in your forms.
I have opened a new feature request for React Native:
https://react-native.canny.io/feature-requests/p/localization-support-for-datepicker
Maybe you wanna upvote it :)
@javiercr @michaelbenker , DatePickerIOS currently supports the locale prop as seen here.
I've created a small PR to add support for it (#556)
Most helpful comment
The datepicker that comes with the bootstrap templates (
datepicker.android.jsanddatepicker.ios.js) uses the native components provided by React Native: DatePickerIOS and DatePickerAndroid.DatePickerIOSis a wrapper around iOS' UIDatePicker. Despite the fact thatUIDatePickerhaslocaleattribute, this is not exposed in the current implementation of RN'sDatePickerIOS(modeis the only attribute exposed).DatePickerAndroidis a wrapper around Android's DatePickerDialog. There are some workarounds to change the language for the native component as explained here but they are not exposed by the RN's component.So in other words, with the current implementation of the datepickers provided by RN (that
tcomb-form-nativerelies on) there is no way to change the language, you're stuck with the system language 馃槙You can look for other datepicker components with localization support and create a
tcomb-form-nativefactory to use them in your forms.