-1

I have trouble with date time picker with mode datetime, currently i use @react-native-community/datetimepicker lib for showing spinner but in iOS i need remove time, only with current day (today, monday, tuesday, ... ) then date.

Anyone has suggest for that. Or this is default of iOS and we cann't modify this.

I have try install another lib like: react-native-date-picker but behavior still same.

Thank for reading and feel free to leave a comment.

[Update]

Sorry because image not clear. I mean i want keep: First day, Month and Day. Same as image updated

enter image description here

Minh Vo
  • 120
  • 6
  • Seems like a quick search leads you to this https://www.npmjs.com/package/@react-native-community/datetimepicker which tells you to pass `mode` as `time`: `` – spasbil Nov 23 '22 at 12:59
  • I mean, i want keep 3 options first and remove time with 12 : 00 and AM / PM. Same as image bellow https://user-images.githubusercontent.com/49482201/203766264-1b7ff080-31c8-4e0a-aadc-f6dbb98f9659.png – Minh Vo Nov 24 '22 at 10:52

2 Answers2

0

You need to pass prop mode="date" like

import DateTimePicker from "@react-native-community/datetimepicker";

<DateTimePicker
      date={date}
      onChange={handleDateChanged}
      mode="date"
    />
Xhirazi
  • 735
  • 4
  • 15
  • I mean, i want keep 3 options first and remove time with 12 : 00 and AM / PM. Same as image bellow https://user-images.githubusercontent.com/49482201/203766264-1b7ff080-31c8-4e0a-aadc-f6dbb98f9659.png – Minh Vo Nov 24 '22 at 10:54
0

You can easily done with:

<DateTimePicker
  display="spinner"
  mode="date"
  ...
/>

it looks like: enter image description here

Andres Lopez
  • 139
  • 1
  • 4
  • 17