datetimepicker
datetimepicker copied to clipboard
Add support for date range picker on Android
Summary
This adds support for Material 3's date range picker. I've added this as an imperative API similar to how the date and time pickers can be called imperatively on Android. Many of the props the new date Material date picker supports are supported here as well. There are some small differences in the following props: value and onChange.
value must be a Range object that looks like {start: Date?, end: Date?}. These are optional and the value prop itself is optional. Leaving it undefined will open the picker with a clean slate.
onChange returns a startTimestamp and endTimestamp in the nativeEvent payload and returns a Range object as the second parameter.
See the README for a screenshot.
Test Plan
What's required for testing (prerequisites)?
What are the steps to reproduce (after prerequisites)?
Compatibility
| OS | Implemented |
|---|---|
| iOS | ❌ |
| Android | ✅ |
Checklist
- [x] I have tested this on a device and a simulator
- [x] I added the documentation in
README.md - [x] I updated the typed files (TS and Flow)
- [x] I added a sample use of the API in the example project (
example/App.js) - [ ] I have added automated tests, either in JS or e2e tests, as applicable