react-native-datepicker icon indicating copy to clipboard operation
react-native-datepicker copied to clipboard

Monthnames / shortcuts are shown wrongly (language condition)

Open seco35 opened this issue 7 years ago • 1 comments

Issue

It's correct in the native datepicker in android. So when choosing date, month names are shown in german. However displayname/month shortcut is still in english. Using IOS both modal's and the TextInput's shortcut is in english.

My current format is, as you can see below in the code: 'DD. MMM YYYY'.

Expected Behavior

Itt should show correct month shortcuts, both on modal and textinput. Using in IOS - since it isn't the native DatePicker - the shortcuts are both on modal and textinput in english. I can't find any option to manipulate the monthdates.

Expecting display shortcuts like this: ["Jan","Feb","Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep","Okt","Nov","Dez"]

Code

                          ref={child => { this.lastPicker=child }}
                          style={{alignSelf: 'center', marginTop:30, width: 250}}
                          date={this.state.lastDate}
                          mode="date"
                          placeholder="Bis"
                          format="DD. MMM YYYY"
                          // minDate="2016-05-01"
                          // maxDate="2016-06-01"
                          confirmBtnText="Bestätigen"
                          cancelBtnText="Abbrechen"
                          customStyles={{
                              dateIcon: {
                                  position: 'absolute',
                                  left: 0,
                                  top: 4,
                                  marginLeft: 0
                              },
                              dateInput: {
                                  marginLeft: 36
                                  }
                              }}
                              onDateChange={(date) => {
                                  this.setState({lastDate: date});
                                  // console.log(date);
                                }
                              }
                              />

Environment

  1. react-native -v: 6.1.0
  2. node -v: 8.11.3
  3. npm -v: 6.1.0
  4. target platform: Android 8 (Huawei MediaPad M5) | iOS 11.4.1 (IPhone SE) <- Both have 'German' as system language.
  5. operating system: Windows 10

seco35 avatar Aug 27 '18 10:08 seco35

+1

AsABarranco avatar Nov 08 '21 12:11 AsABarranco