Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for date range picker on Android #956

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sidorchukandrew
Copy link
Collaborator

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

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)
  • 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

This implementation models how the Material date picker was
implemented. However, the range picker returns two values and
accepts two values for the start and end of the range.
Since this is a new module, I think we should only support the
imperative API the same way we encourage developers to use the
imperative API for the date and time pickers.
@sidorchukandrew sidorchukandrew marked this pull request as ready for review February 4, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant