How can i do custom date picker in react-native

3.7k Views Asked by At

I had used date time picker in react native, but I want to do in my custom UI for the date picker. How can I do it?

I want to do as shown in below image in both android and IOS

2

There are 2 best solutions below

0
On

You can get that look by using the react-native-date-picker library and the following code:

<DatePicker
  date={date}
  onDateChange={setDate}
  mode="date"
/>
1
On

Follow the below steps.

  1. Use new Date API to get Date, Month and Years store them in array.
  2. then display in row so three are side to each other.
  3. Hide Top and Bottom Portion View Using overflow hidden

That is it you can generate a Date Picker like you side.