| minuteInterval | The interval at which minutes can be selected. | <imgsrc="docs/minute-interval-ios.png"alt="Date picker minute interval IOS"height="120px"/> | <imgsrc="docs/minute-interval-android.png"alt="Date picker minute interval Android"height="120px"/> |
| mode | The date picker mode. {'datetime', 'date', 'time'} | <imgsrc="docs/datetime-mode-ios.png"alt="React native date time picker"height="120px"/><imgsrc="docs/date-mode-ios.png"alt="React native datepicker"height="120px"/><imgsrc="docs/time-mode-ios.png"alt="React native time picker"height="120px"/> | <imgsrc="docs/datetime-mode-android.png"alt="react native date time picker android"height="120px"/><imgsrc="docs/date-mode-android.png"alt="react native datepicker android"height="120px"/><imgsrc="docs/time-mode-android.png"alt="react native time picker android"height="120px"/> |
| locale | The locale for the date picker. Changes language, date order and am/pm preferences. Value needs to be a <atitle="react native datepicker locale id"href="https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html">Locale ID.</a> | <imgsrc="docs/locale-ios.png"alt="React Native Date picker locale language ios"height="120px"/> | <imgsrc="docs/locale-android.png"alt="React Native Date picker locale language android"height="120px"/> |
| textColor | Changes the text color. ⚠ Colors other than black (#000000) or white (#ffffff) will replace the "Today" string with a date on iOS 13 or higher. | <imgsrc="docs/colors-ios.png"alt="react native datepicker text color background color ios"height="120px"/> | <imgsrc="docs/colors-android.png"alt="Text color background color android"height="120px"/> |
| dividerHeight | Change the divider height (only supported for iosClone) |
| is24hourSource | Change how the 24h mode (am/pm) should be determined, by device settings or by locale. {'locale', 'device'} (android only, default: 'device') |
| `minuteInterval` | The interval at which minutes can be selected. | <imgsrc="docs/minute-interval-ios.png"alt="Date picker minute interval IOS"height="120px"/> | <imgsrc="docs/minute-interval-android.png"alt="Date picker minute interval Android"height="120px"/> |
| `mode` | The date picker mode. `"datetime"`, `"date"`, `"time"` | <imgsrc="docs/datetime-mode-ios.png"alt="React native date time picker"height="120px"/><imgsrc="docs/date-mode-ios.png"alt="React native datepicker"height="120px"/><imgsrc="docs/time-mode-ios.png"alt="React native time picker"height="120px"/> | <imgsrc="docs/datetime-mode-android.png"alt="react native date time picker android"height="120px"/><imgsrc="docs/date-mode-android.png"alt="react native datepicker android"height="120px"/><imgsrc="docs/time-mode-android.png"alt="react native time picker android"height="120px"/> |
| `locale` | The locale for the date picker. Changes language, date order and am/pm preferences. Value needs to be a <atitle="react native datepicker locale id"href="https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html">Locale ID.</a> | <imgsrc="docs/locale-ios.png"alt="React Native Date picker locale language ios"height="120px"/> | <imgsrc="docs/locale-android.png"alt="React Native Date picker locale language android"height="120px"/> |
| `textColor` | Changes the text color. ⚠ Colors other than black (#000000) or white (#ffffff) will replace the "Today" string with a date on iOS 13 or higher. | <imgsrc="docs/colors-ios.png"alt="react native datepicker text color background color ios"height="120px"/> | <imgsrc="docs/colors-android.png"alt="Text color background color android"height="120px"/> |
| `dividerHeight` | Change the divider height (only supported for iosClone) |
| `is24hourSource` | Change how the 24h mode (am/pm) should be determined, by device settings or by locale. {'locale', 'device'} (android only, default: 'device') |
| `modal` | Boolean indicating if modal should be used. Default: `"false"`. When enabled, the other modal props needs to be used. <ahref="#modal">See example</a>. |
| `open` | Modal only: Boolean indicating if modal should be open. |
| `onConfirm` | Modal only: Date callback when user presses confirm button |
| `onCancel` | Modal only: Callback for when user presses cancel button or closing the modal by pressing outside it. |
| `title` | Modal only: Title text. Can be set to null to remove text. |
This package supports automatic linking. Usually, the only thing you need to do is to install the package, the cocoapods dependencies (as described above). Then rebuild the project by running `react-native run-ios`, `react-native run-android` or start the build from within Xcode/Android Studio. If you're running a React Native version below 0.60 or your setup is having issues with automatic linking, you can run `npx react-native link react-native-date-picker` and rebuild. In some occations you'll have to manually link the package. Instructions in <ahref="https://github.com/henninghall/react-native-date-picker/issues/40">this issue</a>.
## About
📅 React Native Date Picker is a cross platform component working on both iOS and Android. It uses the slightly improved DatePickerIOS on iOS and a custom picker on Android which has similar look and feel. The datetime mode might be particularly interesting if you looking for a way to avoid two different popup pickers on android.
## FAQ
### How do I change the divider color?
@ -169,9 +218,9 @@ On Android there are two design variants to choose from:
<imgsrc="docs/react-native-date-picker-android.gif"alt="date time picker"height="120px"/>
<imgsrc="docs/react-native-date-picker-android.gif"alt="date time picker"height="150px"/>
</td><tdalign="center">
<imgsrc="docs/react-native-date-picker-android-native.gif"alt="date time picker"height="120px"/>
<imgsrc="docs/react-native-date-picker-android-native.gif"alt="date time picker"height="150px"/>
</td></tr>
<tr><td>The so called "iOS clone" looks and works similar to the ios version. It shows normally 5 lines of dates. It is enabled by default.</td><td>
@ -260,8 +309,12 @@ Set mode property to `time` to show the time picker:
/>
```
## Why another React Native datepicker?
## About
React Native Date Picker is a cross platform component for iOS and Android. It uses native code from respective platform to get the genuine look and feel the users expect. A strong motivation for creating this picker was the datetime mode on Android. It's quite unique for the platform and avoids two different picker popups, which normally is necessary. Instead, this datetime mode requires fewer user actions and enables a great user-experience.
## Support this package!
One of the strongest reason to use react native is its cross platform compatibility. Most of the official components are working seamlessly on both platforms but there are some with single platform support only. The react native datepicker is one example where both <ahref="https://facebook.github.io/react-native/docs/datepickerios">DatePickerIOS</a> and <ahref="https://facebook.github.io/react-native/docs/datepickerandroid">DatePickerAndroid</a> are present. The reason for this is that the default date picker is implemented in separate ways, iOS normally have an integrated view picker wheel where android has different pickers in a dialog format.
If you like this package and want to support it, you can give it<ahref="https://openbase.com/js/react-native-date-picker"target="_blank">a review</a>or a github star ⭐
If you want to use these pickers you can combine the official ones or a third party module that already done that for you. If you on the other hand want have a more unified design between your android and ios app, this module is for you. The datetime mode can be particularly helpful to avoid 2 separate picker dialogs on android.
A cross platform <ahref="https://github.com/henninghall/react-native-date-picker"title="React Native Date Pickers">react native date picker</a> component for android and ios. It includes 3 different modes: date, time, and datetime. The date picker is customizable and has multiple language support.
<table>
<tr>
<tdalign="center"><b>iOS</b></td>
</tr>
## Modal
The first option is to use the built-in modal.
<table>
<tr>
<td><imgsrc="https://github.com/henninghall/react-native-date-picker/raw/master/docs/react-native-date-picker.gif"alt="React Native Date Picker"title="React Native Date Picker"height="150px"/>
The second option is to use the picker stand-alone. Inlined in a view or a custom made modal.
<table>
<tr>
<td><imgsrc="https://github.com/henninghall/react-native-date-picker/raw/master/docs/react-native-date-picker-android.gif"alt="React Native Date Picker Android"height="150px"style="margin-left:10px"/>
<td><imgsrc="https://github.com/henninghall/react-native-date-picker/raw/master/docs/react-native-date-time-picker-android-inline.gif"alt="React Native Date Time Picker"height="400px"style="margin-left:10px"/>