Skip to content

Commit 83a9a97

Browse files
authored
docs: update readme (#682)
1 parent 9282fc6 commit 83a9a97

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export const App = () => {
227227

228228
By localization, we refer to the language (names of months and days), as well as order in which date can be presented in a picker (month/day vs. day/month) and 12 / 24 hour-format.
229229

230-
On Android, the picker will be controlled by the system locale. If you wish to change it, [see instructions here](https://stackoverflow.com/a/2900144/2070942).
230+
On Android, the picker will be controlled by the system locale. If you wish to change it, [see instructions here](https://developer.android.com/guide/topics/resources/app-languages).
231231

232232
On iOS, use XCode, as [documented here](https://developer.apple.com/documentation/xcode/adding-support-for-languages-and-regions) to inform the OS about the locales your application supports. iOS will automatically display the correctly localized DateTimePicker as long as the target language is contained in `project.pbxproj`.
233233

@@ -258,7 +258,7 @@ The reason we recommend the imperative API is: on Android, the date/time picker
258258

259259
## Component props / params of the Android imperative api
260260

261-
> Please note that this library currently exposes functionality from [`UIDatePicker`](https://developer.apple.com/documentation/uikit/uidatepicker?language=objc) on iOS and [DatePickerDialog](https://developer.android.com/reference/android/app/DatePickerDialog) + [TimePickerDialog](https://developer.android.com/reference/android/app/TimePickerDialog) on Android, and [`CalendarDatePicker`](https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/calendar-date-picker) +[TimePicker](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.timepicker?view=winrt-19041) on Windows.
261+
> Please note that this library currently exposes functionality from [`UIDatePicker`](https://developer.apple.com/documentation/uikit/uidatepicker?language=objc) on iOS and [DatePickerDialog](https://developer.android.com/reference/android/app/DatePickerDialog) + [TimePickerDialog](https://developer.android.com/reference/android/app/TimePickerDialog) on Android, and [`CalendarDatePicker`](https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/calendar-date-picker) + [TimePicker](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.timepicker?view=winrt-19041) on Windows.
262262
>
263263
> These native classes offer only limited configuration, while there are dozens of possible options you as a developer may need. It follows that if your requirement is not supported by the backing native views, this library will _not_ be able to implement your requirement. When you open an issue with a feature request, please document if (or how) the feature can be implemented using the aforementioned native views. If the native views do not support what you need, such feature requests will be closed as not actionable.
264264
@@ -283,7 +283,7 @@ Defines the visual display of the picker. The default value is `"default"`.
283283

284284
List of possible values for Android
285285

286-
- `"default"` - Show a default date picker (spinner/calendar/clock) based on `mode` and Android version.
286+
- `"default"` - Recommended. Show a default date picker (spinner/calendar/clock) based on `mode`.
287287
- `"spinner"`
288288
- `"calendar"` (only for `date` mode)
289289
- `"clock"` (only for `time` mode)
@@ -308,7 +308,12 @@ It is also called when user dismisses the picker, which you can detect by checki
308308
The values can be: `'set' | 'dismissed' | 'neutralButtonPressed'`. (`neutralButtonPressed` is only available on Android).
309309

310310
```js
311-
setDate = (event, date) => {};
311+
const setDate = (event: DateTimePickerEvent, date: Date) => {
312+
const {
313+
type,
314+
nativeEvent: {timestamp},
315+
} = event;
316+
};
312317

313318
<RNDateTimePicker onChange={this.setDate} />;
314319
```
@@ -326,7 +331,7 @@ Defines the date or time value used in the component.
326331
Defines the maximum date that can be selected. Note that on Android, this only works for `date` mode because [TimePicker](https://developer.android.com/reference/android/widget/TimePicker) does not support this.
327332

328333
```js
329-
<RNDateTimePicker maximumDate={new Date(2300, 10, 20)} />
334+
<RNDateTimePicker maximumDate={new Date(2030, 10, 20)} />
330335
```
331336

332337
#### `minimumDate` (`optional`)
@@ -469,13 +474,13 @@ on iOS, this in only supported when `display="spinner"`
469474

470475
#### `style` (`optional`, `iOS only`)
471476

472-
Sets style directly on picker component. By default, the picker height is determined based on the `display` prop.
477+
Sets style directly on picker component. By default, the picker dimensions are determined based on the props.
473478

474479
Please note that by default, picker's text color is controlled by the application theme (light / dark mode). In dark mode, text is white and in light mode, text is black.
475480
If you want to control the application theme, we recommend using [react-native-theme-control](https://github.com/vonovak/react-native-theme-control).
476481

477482
This means that e.g. if the device has dark mode turned on, and your screen background color is white, you will not see the picker. Please use the `Appearance` api to adjust the picker's background color so that it is visible, as we do in the [example App](/example/App.js).
478-
Alternatively, use the `themeVariant` prop or [opt-out from dark mode (discouraged)](https://stackoverflow.com/a/56546554/2070942).
483+
Alternatively, use the `themeVariant` prop.
479484

480485
```js
481486
<RNDateTimePicker style={{flex: 1}} />

0 commit comments

Comments
 (0)