You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-47Lines changed: 49 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,9 @@ See this [issue](https://github.com/react-native-datetimepicker/datetimepicker/i
28
28
This repository was moved out of the react native community GH organization, in accordance to [this proposal](https://github.com/react-native-community/discussions-and-proposals/issues/176).
29
29
The module is still published on `npm` under the old namespace (as documented) but will be published under a new namespace at some point, with a major version bump.
@@ -117,15 +118,12 @@ React Native date & time picker component for iOS, Android and Windows (please n
117
118
118
119
## Requirements
119
120
120
-
- Only Android API level >=21 (Android 5), iOS >= 11 are supported.
121
-
- Tested with Xcode 14.0 and RN 0.72.7. Other configurations are very likely to work as well but have not been tested.
122
-
123
-
The module supports the [new React Native architecture](https://reactnative.dev/docs/next/the-new-architecture/why) (Fabric rendering of iOS components, and turbomodules on Android). If you are using the new architecture, you will need to use React Native 0.71.4 or higher.
121
+
The module supports the [new React Native architecture](https://reactnative.dev/docs/next/the-new-architecture/why) (Fabric rendering of iOS components, and turbomodules on Android).
124
122
125
123
## Expo users notice
126
124
127
-
This module is part of Expo Managed Workflow - [see docs](https://docs.expo.io/versions/latest/sdk/date-time-picker/). However, Expo SDK in the Managed Workflow may not contain the latest version of the module and therefore, the newest features and bugfixes may not be available in Expo Managed Workflow.
128
-
If you use the Managed Workflow, use the command `expo install @react-native-community/datetimepicker` (not `yarn` or `npm`) to install this module - Expo will automatically install the latest version compatible with your Expo SDK (which may _not_ be the latest version of the module available).
125
+
This module is part of Expo Go - [see docs](https://docs.expo.io/versions/latest/sdk/date-time-picker/). However, Expo Go may not contain the latest version of the module and therefore, the newest features and bugfixes may not be available.
126
+
If you use Expo Go, use the command `npx expo install @react-native-community/datetimepicker` (not `yarn` or `npm`) to install this module - Expo will automatically install the latest version compatible with your Expo SDK (which may _not_ be the latest version of the module available).
129
127
130
128
If you're using a [Dev Client](https://docs.expo.dev/development/create-development-builds/), rebuild the Dev Client after installing the dependencies.
Autolinking is not yet implemented on Windows, so [manual installation ](/docs/manual-installation.md) is needed.
147
145
148
-
#### RN >= 0.60
149
-
150
-
If you are using RN >= 0.60, only run `npx pod-install`. Then rebuild your project.
151
-
152
-
## React Native Support
153
-
154
-
Check the `react-native` version support table below to find the corresponding `datetimepicker` version to meet support requirements. Maintenance is only provided for last 3 stable react-native versions.
155
-
156
-
| react-native version | version |
157
-
| -------------------- | ------- |
158
-
| 0.73.0+ | 7.6.3+ |
159
-
| <=0.72.0 | <=7.6.2 |
160
-
| 0.70.0+ | 7.0.1+ |
161
-
| <0.70.0 | <=7.0.0 |
146
+
On iOS, run `npx pod-install` after installing. Then rebuild your project.
162
147
163
148
## Usage
164
149
@@ -181,15 +166,10 @@ Read more about the motivation in [Android imperative API](#android-imperative-a
Called when the neutral button is pressed. Receives no arguments. See [`neutralButton`](#neutralButton-optional-android-only).
355
+
356
+
```js
357
+
<RNDateTimePicker
358
+
neutralButton={{label:'Clear', textColor:'grey'}}
359
+
onNeutralButtonPress={() =>clearDate()}
360
+
/>
361
+
```
362
+
363
+
#### `onChange` (`optional`, `deprecated`)
364
+
365
+
> **Deprecated:** Use `onValueChange`, `onDismiss`, and `onNeutralButtonPress` instead. If the new specific listeners are provided, they take precedence over `onChange` for their respective event types.
362
366
363
367
Date change handler.
364
368
@@ -554,7 +558,7 @@ Set the positive button label and text color.
554
558
#### `neutralButton` (`optional`, `Android only`)
555
559
556
560
Allows displaying neutral button on picker dialog.
557
-
Pressing button can be observed in onChange handler as `event.type === 'neutralButtonPressed'`
561
+
Pressing the button can be observed via the [`onNeutralButtonPress`](#onneutralbuttonpress-optional-android-only) callback.
0 commit comments