xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 725 forks source link

Time format is not sync in iOS datepicker and display #274

Open wzup opened 6 years ago

wzup commented 6 years ago

Issue

Wrong format in native iOS picker and displayed format: Display is 24h, but picker renders 12h AM/PM

screen shot 2018-07-31 at 4 17 35 pm

Expected Behavior

Both are sync

Code

const pickerShared = {
  mode: 'time',
  placeholder: '00:00',
  format: 'HH:mm',
  androidMode: 'spinner',
  showIcon: false,
  confirmBtnText: "Confirm",
  cancelBtnText: "Cancel",
  customStyles: {
    dateInput: {
      borderWidth: 0,
      alignItems: 'flex-start',
      justifyContent: 'flex-end',
      height: 25,
      paddingBottom: 3,
    },
    dateTouchBody: {
      height: 25,
    },
    placeholderText: {
      fontSize: 20
    },
    dateText: {
      fontSize: 20
    }
  },
  style: {},
  is24Hour: true // Only in Android. For iOS use format
};

Environment

  1. react-native -v: "0.54.2", OS: macOS High Sierra 10.13.4 Node: 8.11.3 Yarn: Not Found npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.4.1 Build version 9F2000 Android Studio: 3.1 AI-173.4819257

Similar https://github.com/xgfe/react-native-datepicker/issues/164

thatgriffith commented 6 years ago

Adding locale={"SV"} worked for me