Tcomb-form-native: Datepicker: Month in german

Created on 23 Mar 2017  路  3Comments  路  Source: gcanti/tcomb-form-native

Version

Tell us which versions you are using:

  • tcomb-form-native v0.6.7
  • react-native v0.41.2

Hello,

how can I get the Month from the Datepicker in german?
Thanx

Most helpful comment

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.

All 3 comments

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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BogdanHossu picture BogdanHossu  路  6Comments

sibelius picture sibelius  路  5Comments

pgmemk picture pgmemk  路  4Comments

scarlac picture scarlac  路  4Comments

dvlprmartins picture dvlprmartins  路  4Comments