├── .eslintrc.js ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml └── workflows │ ├── build-android.yml │ ├── build-ios.yml │ ├── lint.yml │ ├── pr.yml │ ├── publish.yml │ ├── push-main.yml │ ├── test-android-e2e.yml │ ├── test-android-unit.yml │ ├── test-ios-e2e.yml │ ├── test-js.yml │ └── typecheck.yml ├── .gitignore ├── .maestro ├── display-text.yml ├── ios.yml ├── maximum-date.yml ├── minimum-date.yml ├── mode.yml ├── other.yml ├── timezone-offset-in-minutes-daylight-saving.yml ├── timezone-offset-in-minutes.yml ├── utils │ ├── change-locale-and-scroll.yml │ ├── change-maximum-date.yml │ ├── change-minimum-date.yml │ ├── change-mode-date.yml │ ├── change-mode-datetime.yml │ ├── change-mode-time.yml │ ├── change-mode.yml │ ├── change-prop-value.yml │ ├── change-prop.yml │ ├── disable-network-time-zone.yml │ ├── goto-settings-from-app-info.yml │ ├── launch.yml │ ├── reset.yml │ ├── select-region.yml │ ├── select-utc-offset.yml │ ├── set-hour-format.yml │ ├── set-timezone.yml │ ├── swipe-wheel-1-down-ios.yml │ ├── swipe-wheel-1-down.yml │ ├── swipe-wheel-1-modal.yml │ ├── swipe-wheel-1-no-ampm.yml │ ├── swipe-wheel-1-up.yml │ ├── swipe-wheel-1.yml │ ├── swipe-wheel-2-up.yml │ ├── swipe-wheel-2.yml │ ├── swipe-wheel-3-up.yml │ ├── swipe-wheel-3.yml │ ├── swipe-wheel-4.yml │ ├── tap-if-visible.yml │ └── tap.yml └── wheel-order.yml ├── .npmignore ├── .prettierrc.js ├── .watchmanconfig ├── .xcode-version ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradlew ├── gradlew.bat └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── henninghall │ │ │ └── date_picker │ │ │ ├── DateBoundary.java │ │ │ ├── DatePickerManagerImpl.java │ │ │ ├── DatePickerModuleImpl.java │ │ │ ├── DatePickerPackage.java │ │ │ ├── DerivedData.java │ │ │ ├── Emitter.java │ │ │ ├── Formats.java │ │ │ ├── HourDisplayBugWorkaround.java │ │ │ ├── LocaleUtils.java │ │ │ ├── PickerView.java │ │ │ ├── State.java │ │ │ ├── Utils.java │ │ │ ├── generated │ │ │ └── NumberPicker.java │ │ │ ├── models │ │ │ ├── Is24HourSource.java │ │ │ ├── Mode.java │ │ │ └── WheelType.java │ │ │ ├── pickers │ │ │ ├── AndroidNative.java │ │ │ └── Picker.java │ │ │ ├── props │ │ │ ├── DateProp.java │ │ │ ├── DividerColorProp.java │ │ │ ├── HeightProp.java │ │ │ ├── IdProp.java │ │ │ ├── Is24hourSourceProp.java │ │ │ ├── LocaleProp.java │ │ │ ├── MaximumDateProp.java │ │ │ ├── MinimumDateProp.java │ │ │ ├── MinuteIntervalProp.java │ │ │ ├── ModeProp.java │ │ │ ├── Prop.java │ │ │ ├── TextColorProp.java │ │ │ └── TimezoneOffsetInMinutesProp.java │ │ │ ├── ui │ │ │ ├── Accessibility.java │ │ │ ├── PickerWrapper.java │ │ │ ├── SpinnerState.java │ │ │ ├── SpinnerStateListener.java │ │ │ ├── UIManager.java │ │ │ ├── WheelChangeListener.java │ │ │ ├── WheelChangeListenerImpl.java │ │ │ ├── WheelScroller.java │ │ │ └── Wheels.java │ │ │ ├── wheelFunctions │ │ │ ├── AddOnChangeListener.java │ │ │ ├── AnimateToDate.java │ │ │ ├── Hide.java │ │ │ ├── Refresh.java │ │ │ ├── SetDate.java │ │ │ ├── SetDividerColor.java │ │ │ ├── TextColor.java │ │ │ ├── UpdateVisibility.java │ │ │ └── WheelFunction.java │ │ │ └── wheels │ │ │ ├── AmPmWheel.java │ │ │ ├── DateWheel.java │ │ │ ├── DayWheel.java │ │ │ ├── HourWheel.java │ │ │ ├── MinutesWheel.java │ │ │ ├── MonthWheel.java │ │ │ ├── Wheel.java │ │ │ └── YearWheel.java │ └── res │ │ ├── drawable │ │ ├── number_picker_divider_material.xml │ │ └── overlay.xml │ │ ├── layout │ │ ├── native_picker.xml │ │ └── number_picker_material.xml │ │ ├── values-fi │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-he │ │ └── strings.xml │ │ ├── values-nb │ │ └── strings.xml │ │ ├── values-nl │ │ └── strings.xml │ │ ├── values-nn │ │ └── strings.xml │ │ ├── values-no │ │ └── strings.xml │ │ ├── values-sv │ │ └── strings.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── newarch │ └── java │ │ └── com │ │ └── henninghall │ │ └── date_picker │ │ ├── DatePickerManager.java │ │ └── DatePickerModule.java │ └── oldarch │ └── java │ └── com │ └── henninghall │ └── date_picker │ ├── DatePickerManager.java │ └── DatePickerModule.java ├── babel.config.js ├── docs ├── button-colors.png ├── colors-android.png ├── colors-ios.png ├── date-mode-android.png ├── date-mode-ios.png ├── datetime-mode-android.png ├── datetime-mode-ios.png ├── divider-color.png ├── locale-android.png ├── locale-ios.png ├── minute-interval-android.png ├── minute-interval-ios.png ├── react-native-date-picker-android-native.gif ├── react-native-date-picker-android.gif ├── react-native-date-picker-android.png ├── react-native-date-picker.gif ├── react-native-date-time-picker-android-inline.gif ├── react-native-date-time-picker-ios-inline.gif ├── react-native-datetime-picker-modal-android.gif ├── react-native-datetime-picker-modal-ios.gif ├── time-mode-android.png └── time-mode-ios.png ├── examples ├── Rn069 │ ├── .buckconfig │ ├── .bundle │ │ └── config │ ├── .eslintrc.js │ ├── .flowconfig │ ├── .gitignore │ ├── .prettierrc.js │ ├── .ruby-version │ ├── .watchmanconfig │ ├── Gemfile │ ├── Gemfile.lock │ ├── android │ │ ├── app │ │ │ ├── _BUCK │ │ │ ├── build.gradle │ │ │ ├── build_defs.bzl │ │ │ ├── debug.keystore │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── rn069 │ │ │ │ │ └── ReactNativeFlipper.java │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── rn069 │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ ├── MainApplication.java │ │ │ │ │ │ └── newarchitecture │ │ │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ │ │ ├── components │ │ │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ │ │ └── modules │ │ │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ │ ├── jni │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ │ │ ├── MainApplicationModuleProvider.h │ │ │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ │ │ ├── MainComponentsRegistry.cpp │ │ │ │ │ ├── MainComponentsRegistry.h │ │ │ │ │ └── OnLoad.cpp │ │ │ │ └── res │ │ │ │ │ ├── drawable │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ │ └── xml │ │ │ │ │ └── network_security_config.xml │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── ShortestScrollOption.java │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── app.json │ ├── babel.config.js │ ├── config.ini │ ├── index.js │ ├── ios │ │ ├── .xcode.env │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── Rn069.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Rn069.xcscheme │ │ ├── Rn069.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Rn069 │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.mm │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── main.m │ │ └── Rn069Tests │ │ │ ├── Info.plist │ │ │ └── Rn069Tests.m │ ├── manual-tests │ │ └── daylight-saving.md │ ├── metro.config.js │ ├── package.json │ ├── react-native.config.js │ ├── src │ │ ├── App.js │ │ ├── CustomPropValue.js │ │ ├── PropButton.js │ │ ├── PropSlider.js │ │ ├── exampleKeys.js │ │ ├── examples.js │ │ ├── examples │ │ │ ├── Advanced.js │ │ │ ├── DateMode.js │ │ │ ├── Minimal.js │ │ │ ├── Modal.js │ │ │ └── TimeMode.js │ │ ├── locales.js │ │ ├── propPickers │ │ │ ├── DateChange.js │ │ │ ├── LocalePicker.js │ │ │ ├── MinMaxDateChange.js │ │ │ ├── MinuteInterval.js │ │ │ ├── ModePicker.js │ │ │ ├── Scroll.js │ │ │ └── TimeZoneOffsetInMinutes.js │ │ └── utils.js │ └── yarn.lock ├── Rn071 │ ├── .bundle │ │ └── config │ ├── .eslintrc.js │ ├── .gitignore │ ├── .node-version │ ├── .prettierrc.js │ ├── .ruby-version │ ├── .watchmanconfig │ ├── Gemfile │ ├── Gemfile.lock │ ├── __tests__ │ │ └── App-test.tsx │ ├── android │ │ ├── app │ │ │ ├── build.gradle │ │ │ ├── debug.keystore │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── rn071 │ │ │ │ │ └── ReactNativeFlipper.java │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── rn071 │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res │ │ │ │ │ ├── drawable │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ └── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ └── release │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── rn071 │ │ │ │ └── ReactNativeFlipper.java │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── app.json │ ├── babel.config.js │ ├── index.js │ ├── ios │ │ ├── .xcode.env │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── Rn071.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Rn071.xcscheme │ │ ├── Rn071.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Rn071 │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.mm │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── main.m │ │ └── Rn071Tests │ │ │ ├── Info.plist │ │ │ └── Rn071Tests.m │ ├── metro.config.js │ ├── package.json │ ├── react-native.config.js │ ├── src │ │ ├── App.js │ │ ├── CustomPropValue.js │ │ ├── MicroButton.js │ │ ├── PropButton.js │ │ ├── PropSlider.js │ │ ├── exampleKeys.js │ │ ├── examples.js │ │ ├── examples │ │ │ ├── Advanced.js │ │ │ ├── DateMode.js │ │ │ ├── Minimal.js │ │ │ ├── Modal.js │ │ │ └── TimeMode.js │ │ ├── locales.js │ │ ├── propPickers │ │ │ ├── DateChange.js │ │ │ ├── LocalePicker.js │ │ │ ├── MinMaxDateChange.js │ │ │ ├── MinuteInterval.js │ │ │ ├── ModePicker.js │ │ │ ├── Scroll.js │ │ │ └── TimeZoneOffsetInMinutes.js │ │ └── utils.js │ ├── tsconfig.json │ └── yarn.lock ├── Rn072 │ ├── .bundle │ │ └── config │ ├── .eslintrc.js │ ├── .gitignore │ ├── .prettierrc.js │ ├── .watchmanconfig │ ├── App.tsx │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── __tests__ │ │ └── App.test.tsx │ ├── android │ │ ├── app │ │ │ ├── build.gradle │ │ │ ├── debug.keystore │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── rn072 │ │ │ │ │ └── ReactNativeFlipper.java │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── rn072 │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res │ │ │ │ │ ├── drawable │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ └── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── release │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── rn072 │ │ │ │ │ └── ReactNativeFlipper.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── ShortestScrollOption.java │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── app.json │ ├── babel.config.js │ ├── index.js │ ├── ios │ │ ├── .xcode.env │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── Rn072.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Rn072.xcscheme │ │ ├── Rn072.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Rn072 │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.mm │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── main.m │ │ └── Rn072Tests │ │ │ ├── Info.plist │ │ │ └── Rn072Tests.m │ ├── jest.config.js │ ├── metro.config.js │ ├── package.json │ ├── react-native.config.js │ ├── tsconfig.json │ └── yarn.lock ├── Rn073 │ ├── .bundle │ │ └── config │ ├── .eslintrc.js │ ├── .gitignore │ ├── .prettierrc.js │ ├── .watchmanconfig │ ├── App.tsx │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── __tests__ │ │ └── App.test.tsx │ ├── android │ │ ├── app │ │ │ ├── build.gradle │ │ │ ├── debug.keystore │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── rn073 │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ └── MainApplication.kt │ │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── app.json │ ├── babel.config.js │ ├── index.js │ ├── ios │ │ ├── .xcode.env │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── Rn073.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Rn073.xcscheme │ │ ├── Rn073.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── Rn073 │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.mm │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── main.m │ │ └── Rn073Tests │ │ │ ├── Info.plist │ │ │ └── Rn073Tests.m │ ├── jest.config.js │ ├── metro.config.js │ ├── package-lock.json │ ├── package.json │ ├── react-native.config.js │ ├── tsconfig.json │ └── yarn.lock └── manual-tests │ └── daylight-saving.md ├── index.d.ts ├── ios ├── DatePicker.h ├── DatePicker.m ├── RNDatePicker.h ├── RNDatePicker.mm ├── RNDatePickerManager.h └── RNDatePickerManager.mm ├── npmREADME.md ├── package.json ├── react-native-date-picker.podspec ├── scripts ├── NumberPicker.patch ├── available-android-emulator.sh ├── generate-number-picker.sh ├── start-android-emulator.sh └── update-patch.sh ├── src ├── DatePickerAndroid.js ├── DatePickerIOS.js ├── colorConversions.test.js ├── colorToHex.js ├── fabric │ ├── NativeRNDatePicker.js │ ├── NativeRNDatePicker.ts │ ├── RNDatePickerNativeComponent.js │ └── RNDatePickerNativeComponent.ts ├── index.js ├── installationError.js ├── modal.js ├── modules.js ├── propChecker.js └── type-definitions.js ├── tsconfig.json └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('eslint').Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: '@react-native', 5 | rules: { 6 | semi: [2, 'never'], 7 | curly: [2, 'multi-line'], 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [henninghall] 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | workflow_call: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | lint-js: 9 | name: Lint 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | 16 | - name: Node 17 | uses: actions/setup-node@v4 18 | 19 | - name: Install npm dependencies 20 | run: yarn install --frozen-lockfile 21 | 22 | - name: Lint 23 | run: yarn lint 24 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: PR 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request_target: 6 | 7 | jobs: 8 | build-ios: 9 | name: Build 10 | uses: ./.github/workflows/build-ios.yml 11 | 12 | build-android: 13 | name: Build 14 | uses: ./.github/workflows/build-android.yml 15 | 16 | test-ios-e2e: 17 | name: Test 18 | uses: ./.github/workflows/test-ios-e2e.yml 19 | needs: [build-ios] 20 | secrets: inherit 21 | 22 | test-android-e2e: 23 | name: Test 24 | uses: ./.github/workflows/test-android-e2e.yml 25 | needs: [build-android] 26 | secrets: inherit 27 | 28 | test-js: 29 | name: Test 30 | uses: ./.github/workflows/test-js.yml 31 | 32 | test-android-unit: 33 | name: Test 34 | uses: ./.github/workflows/test-android-unit.yml 35 | 36 | lint: 37 | name: Check 38 | uses: ./.github/workflows/lint.yml 39 | 40 | typecheck: 41 | name: Check 42 | uses: ./.github/workflows/typecheck.yml 43 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | workflow_dispatch: 5 | release: 6 | types: [published] 7 | 8 | jobs: 9 | build: 10 | environment: npm - publish 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v1 14 | - uses: actions/setup-node@v4 15 | with: 16 | node-version: 18 17 | registry-url: https://registry.npmjs.org/ 18 | - run: yarn install 19 | - run: npm publish --access public 20 | env: 21 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 22 | -------------------------------------------------------------------------------- /.github/workflows/push-main.yml: -------------------------------------------------------------------------------- 1 | name: Push main 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - master 8 | 9 | jobs: 10 | test-js: 11 | name: Test 12 | uses: ./.github/workflows/test-js.yml 13 | secrets: inherit 14 | 15 | test-android-unit: 16 | name: Test 17 | uses: ./.github/workflows/test-android-unit.yml 18 | secrets: inherit 19 | 20 | build-ios: 21 | name: Build 22 | needs: [test-js, test-android-unit] 23 | uses: ./.github/workflows/build-ios.yml 24 | secrets: inherit 25 | 26 | build-android: 27 | needs: [test-js, test-android-unit] 28 | name: Build 29 | uses: ./.github/workflows/build-android.yml 30 | secrets: inherit 31 | -------------------------------------------------------------------------------- /.github/workflows/test-android-unit.yml: -------------------------------------------------------------------------------- 1 | name: Test Android Unit 2 | 3 | on: 4 | workflow_call: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | test-android-unit: 9 | name: Android - Unit 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v4 14 | with: 15 | ref: ${{ github.event.pull_request.head.sha }} 16 | 17 | - uses: actions/setup-java@v4 18 | with: 19 | java-version: 11 20 | distribution: 'temurin' 21 | 22 | - name: Install npm dependencies 23 | working-directory: ./examples/Rn072 24 | run: yarn install --frozen-lockfile 25 | 26 | - name: Run unit tests 27 | working-directory: ./examples/Rn072/android 28 | run: ./gradlew testDebugUnitTest 29 | -------------------------------------------------------------------------------- /.github/workflows/test-js.yml: -------------------------------------------------------------------------------- 1 | name: Test js 2 | 3 | on: 4 | workflow_call: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | test-js: 9 | name: Javascript 10 | runs-on: ubuntu-latest 11 | timeout-minutes: 5 12 | 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | 17 | - name: Node 18 | uses: actions/setup-node@v4 19 | 20 | - name: Install npm dependencies 21 | run: yarn install --frozen-lockfile 22 | 23 | - name: Run unit tests 24 | run: yarn test 25 | -------------------------------------------------------------------------------- /.github/workflows/typecheck.yml: -------------------------------------------------------------------------------- 1 | name: Types 2 | 3 | on: 4 | workflow_call: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | lint-js: 9 | name: Types 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | 16 | - name: Node 17 | uses: actions/setup-node@v4 18 | 19 | - name: Install npm dependencies 20 | run: yarn install --frozen-lockfile 21 | 22 | - name: Lint 23 | run: yarn typecheck 24 | -------------------------------------------------------------------------------- /.maestro/ios.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | tags: 3 | - ios 4 | --- 5 | # test: can use inline picker 6 | - runFlow: utils/launch.yml 7 | - runFlow: 8 | file: utils/change-prop.yml 9 | env: 10 | PROP: locale 11 | VALUE: vi-VN 12 | - runFlow: utils/swipe-wheel-1-down-ios.yml 13 | - assertVisible: 14 | text: '2000-01-01 01:00:00' 15 | 16 | # test: can use modal 17 | - launchApp 18 | - tapOn: Modal 19 | - tapOn: Select date 20 | - runFlow: utils/swipe-wheel-1-modal.yml 21 | - tapOn: Confirm 22 | - assertVisible: 23 | text: '2000-01-02' 24 | -------------------------------------------------------------------------------- /.maestro/mode.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | tags: 3 | - android 4 | - mode 5 | --- 6 | - runFlow: utils/launch.yml 7 | 8 | # test: 12h time 9 | 10 | # datetime 11 | - tapOn: datetime mode 12 | - runFlow: utils/swipe-wheel-1.yml 13 | - runFlow: utils/swipe-wheel-2.yml 14 | - runFlow: utils/swipe-wheel-3.yml 15 | - runFlow: utils/swipe-wheel-4.yml 16 | - assertVisible: '2000-01-02 13:01:00' 17 | - tapOn: reset date 18 | 19 | # date 20 | - tapOn: date mode 21 | - tapOn: clear maximumDate 22 | - runFlow: utils/swipe-wheel-1.yml 23 | - runFlow: utils/swipe-wheel-2.yml 24 | - runFlow: utils/swipe-wheel-3.yml 25 | - assertVisible: '2001-02-02 00:00:00' 26 | - tapOn: reset date 27 | 28 | # time 29 | - tapOn: time mode 30 | - runFlow: utils/swipe-wheel-1.yml 31 | - runFlow: utils/swipe-wheel-2.yml 32 | - runFlow: utils/swipe-wheel-3.yml 33 | - assertVisible: '2000-01-01 13:01:00' 34 | - tapOn: reset date 35 | 36 | # test: 24h time 37 | - runFlow: 38 | when: 39 | visible: 'time format: 12h' 40 | file: utils/set-hour-format.yml 41 | 42 | - runFlow: utils/launch.yml 43 | 44 | # datetime 45 | - tapOn: datetime mode 46 | - runFlow: utils/swipe-wheel-4.yml # expected not to exist (check needed so that ) 47 | - runFlow: utils/swipe-wheel-1.yml 48 | - runFlow: utils/swipe-wheel-2.yml 49 | - runFlow: utils/swipe-wheel-3.yml 50 | - assertVisible: '2000-01-02 01:01:00' 51 | - tapOn: reset date 52 | 53 | # time 54 | - tapOn: time mode 55 | - runFlow: utils/swipe-wheel-3.yml # expected not to exist 56 | - runFlow: utils/swipe-wheel-1-no-ampm.yml 57 | - runFlow: utils/swipe-wheel-2.yml 58 | - assertVisible: '2000-01-01 01:01:00' 59 | - tapOn: reset date 60 | -------------------------------------------------------------------------------- /.maestro/utils/change-locale-and-scroll.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - tapOn: Clear 4 | - tapOn: reset date 5 | - tapOn: change locale 6 | - tapOn: 7 | id: propValue 8 | - inputText: ${LOCALE} 9 | - hideKeyboard 10 | - tapOn: Change 11 | - runFlow: swipe-wheel-1.yml 12 | - assertVisible: 13 | id: dateStringOutput|dateOutput 14 | text: ${EXPECT} 15 | -------------------------------------------------------------------------------- /.maestro/utils/change-maximum-date.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | file: change-prop.yml 5 | env: 6 | PROP: maximumDate 7 | VALUE: ${VALUE} 8 | -------------------------------------------------------------------------------- /.maestro/utils/change-minimum-date.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | file: change-prop.yml 5 | env: 6 | PROP: minimumDate 7 | VALUE: ${VALUE} 8 | -------------------------------------------------------------------------------- /.maestro/utils/change-mode-date.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | file: change-mode.yml 5 | env: 6 | VALUE: date 7 | -------------------------------------------------------------------------------- /.maestro/utils/change-mode-datetime.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | file: change-mode.yml 5 | env: 6 | VALUE: datetime 7 | -------------------------------------------------------------------------------- /.maestro/utils/change-mode-time.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | file: change-mode.yml 5 | env: 6 | VALUE: time 7 | -------------------------------------------------------------------------------- /.maestro/utils/change-mode.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | file: change-prop.yml 5 | env: 6 | PROP: mode 7 | VALUE: ${VALUE} 8 | -------------------------------------------------------------------------------- /.maestro/utils/change-prop-value.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - tapOn: clear prop value 4 | - tapOn: 5 | id: propValue 6 | - inputText: ${VALUE} 7 | - hideKeyboard 8 | - tapOn: 9 | id: changeProp 10 | -------------------------------------------------------------------------------- /.maestro/utils/change-prop.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - tapOn: clear 4 | - tapOn: 5 | id: propName 6 | - inputText: ${PROP} 7 | - tapOn: 8 | id: propValue 9 | - inputText: ${VALUE} 10 | - hideKeyboard 11 | - tapOn: 12 | id: changeProp 13 | -------------------------------------------------------------------------------- /.maestro/utils/disable-network-time-zone.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - tapOn: 'Use network-provided time zone' 4 | - tapOn: 'Time zone' 5 | -------------------------------------------------------------------------------- /.maestro/utils/goto-settings-from-app-info.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - scrollUntilVisible: 4 | element: 5 | text: 'Settings' 6 | - tapOn: 'Settings' 7 | - tapOn: 'Open' 8 | -------------------------------------------------------------------------------- /.maestro/utils/launch.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - launchApp: 4 | stopApp: true 5 | - tapOn: Advanced 6 | -------------------------------------------------------------------------------- /.maestro/utils/reset.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - tapOn: 'Go back' 4 | - tapOn: Advanced 5 | -------------------------------------------------------------------------------- /.maestro/utils/select-region.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - tapOn: Region 4 | - inputText: ${REGION} 5 | - tapOn: 6 | text: ${REGION} 7 | index: 1 8 | 9 | - runFlow: 10 | when: 11 | true: ${REGION == 'United states'} 12 | file: tap.yml 13 | env: 14 | TEXT: ${STATE} 15 | -------------------------------------------------------------------------------- /.maestro/utils/select-utc-offset.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - tapOn: 'Select UTC offset' 4 | - scrollUntilVisible: 5 | element: 6 | text: ${GMT} 7 | - tapOn: ${GMT} 8 | -------------------------------------------------------------------------------- /.maestro/utils/set-hour-format.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - launchApp 4 | - runFlow: 5 | when: 6 | visible: 'App info' 7 | file: goto-settings-from-app-info.yml 8 | - tapOn: 'Search settings' 9 | - inputText: 'Date' 10 | - tapOn: 'Date & time' 11 | - tapOn: 'Date & time' 12 | 13 | - runFlow: 14 | commands: 15 | - tapOn: 'Use locale default' 16 | - tapOn: 'Use 24-hour format' 17 | -------------------------------------------------------------------------------- /.maestro/utils/set-timezone.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - launchApp 4 | - runFlow: 5 | when: 6 | visible: 'App info' 7 | file: goto-settings-from-app-info.yml 8 | - tapOn: 'Search settings' 9 | - inputText: 'Date' 10 | - tapOn: 'Date & time' 11 | - tapOn: 'Date & time' 12 | - tapOn: 'Time zone' 13 | - runFlow: 14 | when: 15 | notVisible: 'Select time zone' 16 | file: disable-network-time-zone.yml 17 | 18 | # on some devices (maestro cloud) "Select UTC offset" is displayed instead of Region 19 | - runFlow: 20 | when: 21 | visible: 'Select UTC offset' 22 | file: select-utc-offset.yml 23 | env: 24 | GMT: ${GMT} 25 | # on most(?) devices timezone is selected by picking region 26 | - runFlow: 27 | when: 28 | visible: Region 29 | file: select-region.yml 30 | env: 31 | REGION: ${REGION} 32 | STATE: ${STATE} 33 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-1-down-ios.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 25%, 40% 5 | end: 25%, 35% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-1-down.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 35%, 40% 5 | end: 35%, 32% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-1-modal.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 25%, 80% 5 | end: 25%, 75% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-1-no-ampm.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 45%, 40% 5 | end: 45%, 32% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-1-up.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 35%, 32% 5 | end: 35%, 40% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-1.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - runFlow: 4 | when: 5 | true: ${DIRECTION == 'UP'} 6 | file: swipe-wheel-1-up.yml 7 | - runFlow: 8 | when: 9 | true: ${DIRECTION != 'UP'} 10 | file: swipe-wheel-1-down.yml 11 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-2-up.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 53%, 32% 5 | end: 53%, 40% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-2.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 53%, 40% 5 | end: 53%, 32% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-3-up.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 65%, 32% 5 | end: 65%, 40% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-3.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 65%, 40% 5 | end: 65%, 32% 6 | -------------------------------------------------------------------------------- /.maestro/utils/swipe-wheel-4.yml: -------------------------------------------------------------------------------- 1 | appId: com.rn071 2 | --- 3 | - swipe: 4 | start: 75%, 40% 5 | end: 75%, 32% 6 | -------------------------------------------------------------------------------- /.maestro/utils/tap-if-visible.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - runFlow: 4 | when: 5 | visible: ${TEXT} 6 | file: tap.yml 7 | env: 8 | TEXT: ${TEXT} 9 | -------------------------------------------------------------------------------- /.maestro/utils/tap.yml: -------------------------------------------------------------------------------- 1 | appId: com.android.settings 2 | --- 3 | - tapOn: ${TEXT} 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo 2 | docs 3 | example 4 | example-cocoapods 5 | examples 6 | githubREADME.md 7 | .gitignore 8 | scripts 9 | .maestro -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSameLine: true, 3 | bracketSpacing: true, 4 | singleQuote: true, 5 | semi: false, 6 | } 7 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.xcode-version: -------------------------------------------------------------------------------- 1 | 14.3.1 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Henning Hall 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/DateBoundary.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker; 2 | 3 | 4 | import java.util.Calendar; 5 | import java.util.TimeZone; 6 | 7 | public class DateBoundary { 8 | private Calendar date; 9 | 10 | DateBoundary(TimeZone timezone, String date) { 11 | if(date == null) return; 12 | Calendar cal = Utils.isoToCalendar(date, timezone); 13 | this.date = Utils.getTruncatedCalendarOrNull(cal); 14 | } 15 | 16 | protected Calendar get() { 17 | return this.date; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/HourDisplayBugWorkaround.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker; 2 | 3 | /** 4 | * This workaround prevents a bug existing in the NativeAndroid variant. 5 | * The bug displays duplicated "12" hours string when the current time is set to "1". 6 | * Haven't found the root cause of this bug but since this bug only occurs in the NativeAndroid 7 | * variant there are reasons to believe there is a internal bug in Android's NumberPicker for this 8 | * use case. 9 | * 10 | * More info about the bug: 11 | * https://github.com/henninghall/react-native-date-picker/issues/382 12 | */ 13 | public class HourDisplayBugWorkaround { 14 | 15 | private final State state; 16 | 17 | public HourDisplayBugWorkaround(State state) { 18 | this.state = state; 19 | } 20 | 21 | private boolean shouldApply(String displayValue) { 22 | if(displayValue.length() != 1) return false; 23 | return true; 24 | } 25 | 26 | private String adjust(String displayValue) { 27 | return " " + displayValue + " "; 28 | } 29 | 30 | public String adjustValueIfNecessary(String displayValue) { 31 | if(!shouldApply(displayValue)) return displayValue; 32 | return adjust(displayValue); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/models/Is24HourSource.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.models; 2 | 3 | public enum Is24HourSource { 4 | device, locale 5 | } 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/models/Mode.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.models; 2 | 3 | public enum Mode { 4 | date, time, datetime 5 | } 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/models/WheelType.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.models; 2 | 3 | public enum WheelType { 4 | DAY, DATE, MONTH, YEAR, HOUR, MINUTE, AM_PM 5 | } 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/pickers/Picker.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.pickers; 2 | 3 | import android.graphics.Paint; 4 | import android.view.View; 5 | 6 | public interface Picker { 7 | void setTextAlign(Paint.Align align); 8 | void smoothScrollToValue(int value); 9 | void smoothScrollToValue(int value, boolean needRespond); 10 | void setMaxValue(int value); 11 | void setMinValue(int value); 12 | int getMaxValue(); 13 | boolean getWrapSelectorWheel(); 14 | void setDisplayedValues(String[] value); 15 | String[] getDisplayedValues(); 16 | int getValue(); 17 | void setValue(int value); 18 | void setTextColor(String value); 19 | void setOnValueChangeListenerInScrolling(Picker.OnValueChangeListenerInScrolling listener); 20 | void setOnValueChangedListener(Picker.OnValueChangeListener onValueChangeListener); 21 | View getView(); 22 | void setVisibility(int visibility); 23 | void setWrapSelectorWheel(boolean wrapSelectorWheel); 24 | boolean isSpinning(); 25 | void setDividerColor(String color); 26 | interface OnValueChangeListenerInScrolling { 27 | void onValueChangeInScrolling(Picker picker, int oldVal, int newVal); 28 | } 29 | 30 | interface OnValueChangeListener { 31 | void onValueChange(); 32 | void onSpinnerStateChange(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/DateProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class DateProp extends Prop { 6 | public static final String name = "date"; 7 | 8 | @Override 9 | public String toValue(Dynamic value){ 10 | return value.asString(); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/DividerColorProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class DividerColorProp extends Prop { 6 | public static final String name = "dividerColor"; 7 | 8 | @Override 9 | public String toValue(Dynamic value){ 10 | return value.asString(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/HeightProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class HeightProp extends Prop { 6 | public static final String name = "height"; 7 | 8 | @Override 9 | public Integer toValue(Dynamic value){ 10 | return value.asInt(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/IdProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class IdProp extends Prop { 6 | public static final String name = "id"; 7 | 8 | @Override 9 | public String toValue(Dynamic value){ 10 | return value.asString(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/Is24hourSourceProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | import com.henninghall.date_picker.models.Is24HourSource; 5 | 6 | public class Is24hourSourceProp extends Prop { 7 | public static final String name = "is24hourSource"; 8 | 9 | @Override 10 | public Is24HourSource toValue(Dynamic value){ 11 | return Is24HourSource.valueOf(value.asString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/LocaleProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import android.os.Build; 4 | 5 | import com.facebook.react.bridge.Dynamic; 6 | import com.henninghall.date_picker.LocaleUtils; 7 | 8 | 9 | import java.util.Locale; 10 | 11 | public class LocaleProp extends Prop { 12 | public static final String name = "locale"; 13 | private String languageTag = getDefaultLanguageTag(); 14 | 15 | public LocaleProp(){ 16 | super(getDefaultLocale()); 17 | } 18 | 19 | static private Locale getDefaultLocale(){ 20 | return LocaleUtils.getLocale(getDefaultLanguageTag()); 21 | } 22 | 23 | static private String getDefaultLanguageTag(){ 24 | return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP 25 | ? Locale.getDefault().toLanguageTag().replace('-', '_') 26 | : "en"; 27 | } 28 | 29 | public String getLanguageTag(){ 30 | return languageTag; 31 | } 32 | 33 | @Override 34 | public Locale toValue(Dynamic value){ 35 | this.languageTag = value.asString().replace('-','_'); 36 | return LocaleUtils.getLocale(languageTag); 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/MaximumDateProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class MaximumDateProp extends Prop { 6 | public static final String name = "maximumDate"; 7 | 8 | @Override 9 | public String toValue(Dynamic value){ 10 | return value.asString(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/MinimumDateProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class MinimumDateProp extends Prop { 6 | public static final String name = "minimumDate"; 7 | 8 | @Override 9 | public String toValue(Dynamic value){ 10 | return value.asString(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/MinuteIntervalProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | import com.henninghall.date_picker.models.Mode; 5 | 6 | public class MinuteIntervalProp extends Prop { 7 | public static final String name = "minuteInterval"; 8 | 9 | public MinuteIntervalProp(){ 10 | super(1); 11 | } 12 | 13 | public Integer toValue(Dynamic value){ 14 | return value.asInt(); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/ModeProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | import com.henninghall.date_picker.models.Mode; 5 | 6 | public class ModeProp extends Prop { 7 | public static final String name = "mode"; 8 | 9 | @Override 10 | public Mode toValue(Dynamic value){ 11 | return Mode.valueOf(value.asString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/Prop.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public abstract class Prop { 6 | private T value; 7 | 8 | public Prop() { } 9 | 10 | public Prop(T defaultValue) { 11 | value = defaultValue; 12 | } 13 | 14 | abstract T toValue(Dynamic value); 15 | 16 | public void setValue(Dynamic value){ 17 | this.value = toValue(value); 18 | } 19 | 20 | public T getValue(){ 21 | return value; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/TextColorProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class TextColorProp extends Prop { 6 | public static final String name = "textColor"; 7 | 8 | @Override 9 | public String toValue(Dynamic value){ 10 | return value.asString(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/props/TimezoneOffsetInMinutesProp.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.props; 2 | 3 | import com.facebook.react.bridge.Dynamic; 4 | 5 | public class TimezoneOffsetInMinutesProp extends Prop { 6 | public static final String name = "timezoneOffsetInMinutes"; 7 | 8 | @Override 9 | String toValue(Dynamic value) { 10 | if(value.isNull()) return null; 11 | return value.asString(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/ui/PickerWrapper.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.ui; 2 | 3 | import android.view.View; 4 | import android.widget.LinearLayout; 5 | 6 | import com.henninghall.date_picker.R; 7 | 8 | class PickerWrapper { 9 | private final LinearLayout view; 10 | 11 | PickerWrapper(View rootView) { 12 | view = (LinearLayout) rootView.findViewById(R.id.pickerWrapper); 13 | view.setWillNotDraw(false); 14 | } 15 | 16 | void addPicker(View wheel) { view.addView(wheel); } 17 | 18 | void addPicker(View wheel, int index) { view.addView(wheel,index); } 19 | 20 | void removeAll() { 21 | view.removeAllViews(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/ui/SpinnerState.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.ui; 2 | 3 | public enum SpinnerState { 4 | idle, 5 | spinning 6 | } 7 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/ui/SpinnerStateListener.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.ui; 2 | 3 | public interface SpinnerStateListener { 4 | void onChange(SpinnerState event); 5 | } 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/ui/WheelChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.ui; 2 | 3 | import com.henninghall.date_picker.wheels.Wheel; 4 | 5 | public interface WheelChangeListener { 6 | 7 | void onChange(Wheel picker); 8 | 9 | void onStateChange(Wheel picker); 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/ui/WheelScroller.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.ui; 2 | 3 | import com.henninghall.date_picker.pickers.Picker; 4 | import com.henninghall.date_picker.wheels.Wheel; 5 | 6 | public class WheelScroller { 7 | 8 | public void scroll(Wheel wheel, int scrollTimes) { 9 | Picker picker = wheel.picker; 10 | int currentIndex = picker.getValue(); 11 | int maxValue = picker.getMaxValue(); 12 | boolean isWrapping = picker.getWrapSelectorWheel(); 13 | int nextValue = currentIndex + scrollTimes; 14 | if(nextValue <= maxValue || isWrapping) { 15 | picker.smoothScrollToValue(nextValue % (maxValue + 1)); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/AddOnChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.pickers.Picker; 4 | import com.henninghall.date_picker.ui.WheelChangeListener; 5 | import com.henninghall.date_picker.wheels.Wheel; 6 | 7 | 8 | public class AddOnChangeListener implements WheelFunction { 9 | 10 | private final WheelChangeListener onChangeListener; 11 | 12 | public AddOnChangeListener(WheelChangeListener onChangeListener){ 13 | this.onChangeListener = onChangeListener; 14 | } 15 | 16 | @Override 17 | public void apply(final Wheel wheel) { 18 | wheel.picker.setOnValueChangedListener(new Picker.OnValueChangeListener() { 19 | @Override 20 | public void onValueChange() { 21 | onChangeListener.onChange(wheel); 22 | } 23 | 24 | @Override 25 | public void onSpinnerStateChange() { 26 | onChangeListener.onStateChange(wheel); 27 | } 28 | }); 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/AnimateToDate.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.wheels.Wheel; 4 | 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | 8 | public class AnimateToDate implements WheelFunction { 9 | 10 | private Calendar date; 11 | 12 | public AnimateToDate(Calendar date) { 13 | this.date = date; 14 | } 15 | 16 | @Override 17 | public void apply(Wheel wheel) { 18 | wheel.animateToDate(date); 19 | } 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/Hide.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import android.view.View; 4 | 5 | import com.henninghall.date_picker.wheels.Wheel; 6 | 7 | public class Hide implements WheelFunction { 8 | 9 | @Override 10 | public void apply(Wheel wheel) { 11 | wheel.picker.setVisibility(View.GONE); 12 | } 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/Refresh.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.wheels.Wheel; 4 | 5 | public class Refresh implements WheelFunction { 6 | 7 | @Override 8 | public void apply(Wheel wheel) { 9 | wheel.refresh(); 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/SetDate.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.wheels.Wheel; 4 | 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | 8 | public class SetDate implements WheelFunction { 9 | 10 | private Calendar date; 11 | 12 | public SetDate(Calendar date) { 13 | this.date = date; 14 | } 15 | 16 | @Override 17 | public void apply(Wheel wheel) { 18 | wheel.setValue(date); 19 | } 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/SetDividerColor.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.wheelFunctions.WheelFunction; 4 | import com.henninghall.date_picker.wheels.Wheel; 5 | 6 | public class SetDividerColor implements WheelFunction { 7 | private final String color; 8 | 9 | public SetDividerColor(String color) { 10 | this.color = color; 11 | } 12 | 13 | @Override 14 | public void apply(Wheel wheel) { 15 | wheel.setDividerColor(color); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/TextColor.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import android.graphics.Color; 4 | 5 | import com.henninghall.date_picker.wheels.Wheel; 6 | 7 | public class TextColor implements WheelFunction { 8 | 9 | private final String color; 10 | 11 | public TextColor(String color) { 12 | this.color = color; 13 | } 14 | 15 | @Override 16 | public void apply(Wheel wheel) { 17 | wheel.picker.setTextColor(color); 18 | } 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/UpdateVisibility.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.wheels.Wheel; 4 | 5 | public class UpdateVisibility implements WheelFunction { 6 | 7 | @Override 8 | public void apply(Wheel wheel) { 9 | wheel.updateVisibility(); 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheelFunctions/WheelFunction.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheelFunctions; 2 | 3 | import com.henninghall.date_picker.wheels.Wheel; 4 | 5 | public interface WheelFunction { 6 | 7 | void apply(Wheel wheel); 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheels/AmPmWheel.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheels; 2 | 3 | import android.graphics.Paint; 4 | 5 | import com.henninghall.date_picker.pickers.Picker; 6 | import com.henninghall.date_picker.State; 7 | import com.henninghall.date_picker.Utils; 8 | import com.henninghall.date_picker.models.Mode; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Calendar; 12 | 13 | 14 | public class AmPmWheel extends Wheel { 15 | 16 | public AmPmWheel(final Picker picker, State state) { 17 | super(picker, state); 18 | } 19 | 20 | @Override 21 | public ArrayList getValues() { 22 | Calendar cal = Calendar.getInstance(); 23 | // Getting the hours from a date that will never have daylight saving to be sure 24 | // cal.add() will work properly. 25 | cal.set(2000,0,0,0,0,0); 26 | ArrayList values = new ArrayList<>(); 27 | 28 | cal.set(Calendar.HOUR_OF_DAY, 0); 29 | values.add(format.format(cal.getTime())); 30 | 31 | cal.add(Calendar.HOUR_OF_DAY, 12); 32 | values.add(format.format(cal.getTime())); 33 | return values; 34 | } 35 | 36 | @Override 37 | public boolean visible() { 38 | return state.derived.usesAmPm() && state.getMode() != Mode.date; 39 | } 40 | 41 | @Override 42 | public boolean wrapSelectorWheel() { 43 | return false; 44 | } 45 | 46 | @Override 47 | public String getFormatPattern() { 48 | return state.derived.usesAmPm() ? " a " : ""; 49 | } 50 | 51 | @Override 52 | public Paint.Align getTextAlign() { 53 | return Paint.Align.RIGHT; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheels/DateWheel.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheels; 2 | 3 | import android.graphics.Paint; 4 | 5 | import java.util.*; 6 | import com.henninghall.date_picker.*; 7 | import com.henninghall.date_picker.models.Mode; 8 | import com.henninghall.date_picker.pickers.Picker; 9 | 10 | public class DateWheel extends Wheel 11 | { 12 | public DateWheel(final Picker picker, final State id) { 13 | super(picker, id); 14 | } 15 | 16 | 17 | @Override 18 | public ArrayList getValues() { 19 | Calendar cal = Calendar.getInstance(); 20 | ArrayList values = new ArrayList<>(); 21 | cal.set(Calendar.MONTH, 0); 22 | cal.set(Calendar.DATE, 1); 23 | final int maxDate = 31; 24 | final int minDate = 1; 25 | for (int i = minDate; i <= maxDate; ++i) { 26 | values.add(getLocaleString(cal)); 27 | cal.add(Calendar.DATE, 1); 28 | } 29 | return values; 30 | } 31 | 32 | @Override 33 | public boolean visible() { 34 | return state.getMode() == Mode.date; 35 | } 36 | 37 | @Override 38 | public boolean wrapSelectorWheel() { 39 | return true; 40 | } 41 | 42 | @Override 43 | public String getFormatPattern() { 44 | return LocaleUtils.getDate(state.getLocaleLanguageTag()); 45 | } 46 | 47 | @Override 48 | public Paint.Align getTextAlign() { 49 | return Paint.Align.RIGHT; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheels/MinutesWheel.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheels; 2 | 3 | import android.graphics.Paint; 4 | 5 | import com.henninghall.date_picker.pickers.Picker; 6 | import com.henninghall.date_picker.State; 7 | import com.henninghall.date_picker.Utils; 8 | import com.henninghall.date_picker.models.Mode; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Calendar; 12 | 13 | public class MinutesWheel extends Wheel { 14 | 15 | public MinutesWheel(Picker picker, State id) { 16 | super(picker, id); 17 | } 18 | 19 | @Override 20 | public ArrayList getValues() { 21 | Calendar cal = Calendar.getInstance(); 22 | ArrayList values = new ArrayList<>(); 23 | 24 | cal.set(Calendar.MINUTE, 0); 25 | for(int i=0; i<60; i = i + state.getMinuteInterval()) { 26 | values.add(format.format(cal.getTime())); 27 | cal.add(Calendar.MINUTE, state.getMinuteInterval()); 28 | } 29 | 30 | return values; 31 | } 32 | 33 | @Override 34 | public boolean visible() { 35 | return state.getMode() != Mode.date; 36 | } 37 | 38 | @Override 39 | public boolean wrapSelectorWheel() { 40 | return true; 41 | } 42 | 43 | @Override 44 | public String getFormatPattern() { 45 | return "mm"; 46 | } 47 | 48 | @Override 49 | public Paint.Align getTextAlign() { 50 | return state.derived.hasOnly2Wheels() ? Paint.Align.LEFT : Paint.Align.RIGHT; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /android/src/main/java/com/henninghall/date_picker/wheels/MonthWheel.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker.wheels; 2 | 3 | import android.graphics.Paint; 4 | 5 | import java.util.*; 6 | import com.henninghall.date_picker.*; 7 | import com.henninghall.date_picker.models.Mode; 8 | import com.henninghall.date_picker.pickers.Picker; 9 | 10 | public class MonthWheel extends Wheel 11 | { 12 | public MonthWheel(final Picker picker, final State id) { 13 | super(picker, id); 14 | } 15 | 16 | @Override 17 | public ArrayList getValues() { 18 | ArrayList values = new ArrayList<>(); 19 | Calendar cal = Calendar.getInstance(); 20 | 21 | cal.set(Calendar.MONTH, 0); 22 | for (int i = 0; i <= 11; ++i) { 23 | values.add(getLocaleString(cal)); 24 | cal.add(Calendar.MONTH, 1); 25 | } 26 | return values; 27 | } 28 | 29 | @Override 30 | public boolean visible() { 31 | return state.getMode() == Mode.date; 32 | } 33 | 34 | @Override 35 | public boolean wrapSelectorWheel() { 36 | return true; 37 | } 38 | 39 | @Override 40 | public String getFormatPattern() { 41 | return "LLLL"; 42 | } 43 | 44 | @Override 45 | public Paint.Align getTextAlign() { 46 | return Paint.Align.LEFT; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /android/src/main/res/drawable/number_picker_divider_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/overlay.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 11 | -------------------------------------------------------------------------------- /android/src/main/res/layout/number_picker_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/values-fi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Päivämääränvalitsin 4 | Valitse Vuosi 5 | Valitse Kuukausi 6 | Valitse Päivämäärä 7 | Valitse Päivä 8 | Valitse Tunti 9 | Valitse Minuutit 10 | Valitse am/pm 11 | Kello on 12 | Tunti: 13 | Minuutit 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Date Picker Overlay 4 | Sélectionnez l\'année 5 | Sélectionnez le mois 6 | Sélectionnez la date 7 | Sélectionnez le jour 8 | Sélectionnez l\'heure 9 | Sélectionnez les minutes 10 | Sélectionnez AM/PM 11 | Le temps est 12 | Heure : 13 | Minutes 14 | -------------------------------------------------------------------------------- /android/src/main/res/values-he/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | בוחר תאריכים צף 3 | בחירת שנה 4 | בחירת חודש 5 | בחירת תאריך 6 | בחירת יום 7 | בחירת שעה 8 | בחירת דקות 9 | בחירה ב־AM/PM 10 | השעה היא 11 | שעה : 12 | דקות 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/res/values-nb/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datovelger 4 | Velg år 5 | Velg måned 6 | Velg dato 7 | Velg dag 8 | Velg time 9 | Velg minutter 10 | Velg am/pm 11 | Tiden er 12 | Time 13 | Minutter 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Date Picker Overlay 4 | Selecteer jaar 5 | Selecteer maand 6 | Selecteer datum 7 | Selecteer dag 8 | Selecteer uur 9 | Selecteer minuten 10 | Selecteer AM/PM 11 | Tijd is 12 | Uur : 13 | Minuten 14 | -------------------------------------------------------------------------------- /android/src/main/res/values-nn/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datoveljar 4 | Vel år 5 | Vel månad 6 | Vel dato 7 | Vel dag 8 | Vel time 9 | Vel minutt 10 | Vel am/pm 11 | Tida er 12 | Time 13 | Minutt 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/values-no/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datovelger 4 | Velg år 5 | Velg måned 6 | Velg dato 7 | Velg dag 8 | Velg time 9 | Velg minutter 10 | Velg am/pm 11 | Tiden er 12 | Time 13 | Minutter 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/values-sv/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datumväljare på 4 | Välj ett år 5 | Välj en månad 6 | Välj ett datum 7 | Välj en dag 8 | Välj en timme 9 | Välj minuter 10 | Välj am/pm 11 | Tiden är 12 | Timme: 13 | Minuter 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Date Picker Overlay 3 | Select Year 4 | Select Month 5 | Select Date 6 | Select Day 7 | Select Hour 8 | Select Minutes 9 | Select AM/PM 10 | Time is 11 | Hour : 12 | Minutes 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 17 | 20 | -------------------------------------------------------------------------------- /android/src/newarch/java/com/henninghall/date_picker/DatePickerModule.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.bridge.ReadableMap; 7 | 8 | import net.time4j.android.ApplicationStarter; 9 | 10 | public class DatePickerModule extends NativeRNDatePickerSpec { 11 | 12 | private final DatePickerModuleImpl module; 13 | 14 | DatePickerModule(ReactApplicationContext context) { 15 | super(context); 16 | ApplicationStarter.initialize(context, false); // false = no need to prefetch on time data background tread 17 | module = new DatePickerModuleImpl(context); 18 | } 19 | 20 | @Override 21 | public void addListener(String eventName) { 22 | // Keep: Required for RN built in Event Emitter Calls. 23 | } 24 | 25 | @Override 26 | public void removeListeners(double type) { 27 | // Keep: Required for RN built in Event Emitter Calls. 28 | } 29 | 30 | @Override 31 | public void openPicker(ReadableMap props){ 32 | module.openPicker(props); 33 | } 34 | 35 | @Override 36 | public void closePicker(){ 37 | module.closePicker(); 38 | } 39 | 40 | @Override 41 | @NonNull 42 | public String getName() { 43 | return DatePickerModuleImpl.NAME; 44 | } 45 | } -------------------------------------------------------------------------------- /android/src/oldarch/java/com/henninghall/date_picker/DatePickerModule.java: -------------------------------------------------------------------------------- 1 | package com.henninghall.date_picker; 2 | 3 | 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | import com.facebook.react.bridge.ReadableMap; 8 | 9 | public class DatePickerModule extends ReactContextBaseJavaModule { 10 | 11 | private final DatePickerModuleImpl module; 12 | 13 | DatePickerModule(ReactApplicationContext context) { 14 | super(context); 15 | module = new DatePickerModuleImpl(context); 16 | } 17 | 18 | @ReactMethod 19 | public void addListener(String eventName) { 20 | // Keep: Required for RN built in Event Emitter Calls. 21 | } 22 | 23 | @ReactMethod 24 | public void removeListeners(Integer count) { 25 | // Keep: Required for RN built in Event Emitter Calls. 26 | } 27 | 28 | @ReactMethod 29 | public void openPicker(ReadableMap props) { 30 | module.openPicker(props); 31 | } 32 | 33 | @ReactMethod 34 | public void closePicker(){ 35 | module.closePicker(); 36 | } 37 | 38 | @Override 39 | public String getName() { 40 | return DatePickerModuleImpl.NAME; 41 | } 42 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /docs/button-colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/button-colors.png -------------------------------------------------------------------------------- /docs/colors-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/colors-android.png -------------------------------------------------------------------------------- /docs/colors-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/colors-ios.png -------------------------------------------------------------------------------- /docs/date-mode-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/date-mode-android.png -------------------------------------------------------------------------------- /docs/date-mode-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/date-mode-ios.png -------------------------------------------------------------------------------- /docs/datetime-mode-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/datetime-mode-android.png -------------------------------------------------------------------------------- /docs/datetime-mode-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/datetime-mode-ios.png -------------------------------------------------------------------------------- /docs/divider-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/divider-color.png -------------------------------------------------------------------------------- /docs/locale-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/locale-android.png -------------------------------------------------------------------------------- /docs/locale-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/locale-ios.png -------------------------------------------------------------------------------- /docs/minute-interval-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/minute-interval-android.png -------------------------------------------------------------------------------- /docs/minute-interval-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/minute-interval-ios.png -------------------------------------------------------------------------------- /docs/react-native-date-picker-android-native.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-date-picker-android-native.gif -------------------------------------------------------------------------------- /docs/react-native-date-picker-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-date-picker-android.gif -------------------------------------------------------------------------------- /docs/react-native-date-picker-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-date-picker-android.png -------------------------------------------------------------------------------- /docs/react-native-date-picker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-date-picker.gif -------------------------------------------------------------------------------- /docs/react-native-date-time-picker-android-inline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-date-time-picker-android-inline.gif -------------------------------------------------------------------------------- /docs/react-native-date-time-picker-ios-inline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-date-time-picker-ios-inline.gif -------------------------------------------------------------------------------- /docs/react-native-datetime-picker-modal-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-datetime-picker-modal-android.gif -------------------------------------------------------------------------------- /docs/react-native-datetime-picker-modal-ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/react-native-datetime-picker-modal-ios.gif -------------------------------------------------------------------------------- /docs/time-mode-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/time-mode-android.png -------------------------------------------------------------------------------- /docs/time-mode-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/docs/time-mode-ios.png -------------------------------------------------------------------------------- /examples/Rn069/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /examples/Rn069/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /examples/Rn069/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | plugins: [], 5 | overrides: [ 6 | { 7 | files: ['**/*.spec.js', '**/*.spec.jsx', '*.js'], 8 | env: { 9 | jest: true, 10 | 'jest/globals': true, 11 | }, 12 | }, 13 | ], 14 | }; 15 | -------------------------------------------------------------------------------- /examples/Rn069/.gitignore: -------------------------------------------------------------------------------- 1 | artifacts 2 | 3 | # OSX 4 | # 5 | .DS_Store 6 | 7 | # Xcode 8 | # 9 | build/ 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | *.xccheckout 20 | *.moved-aside 21 | DerivedData 22 | *.hmap 23 | *.ipa 24 | *.xcuserstate 25 | ios/.xcode.env.local 26 | 27 | # Android/IntelliJ 28 | # 29 | build/ 30 | .idea 31 | .gradle 32 | local.properties 33 | *.iml 34 | *.hprof 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | yarn-error.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | !debug.keystore 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://docs.fastlane.tools/best-practices/source-control/ 54 | 55 | **/fastlane/report.xml 56 | **/fastlane/Preview.html 57 | **/fastlane/screenshots 58 | **/fastlane/test_output 59 | 60 | # Bundle artifact 61 | *.jsbundle 62 | 63 | # Ruby / CocoaPods 64 | /ios/Pods/ 65 | /vendor/bundle/ 66 | -------------------------------------------------------------------------------- /examples/Rn069/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /examples/Rn069/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /examples/Rn069/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /examples/Rn069/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.rn069", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.rn069", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/debug.keystore -------------------------------------------------------------------------------- /examples/Rn069/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 14 | > 15 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/java/com/rn069/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.rn069.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | THIS_DIR := $(call my-dir) 2 | 3 | include $(REACT_ANDROID_DIR)/Android-prebuilt.mk 4 | 5 | # If you wish to add a custom TurboModule or Fabric component in your app you 6 | # will have to include the following autogenerated makefile. 7 | # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_PATH := $(THIS_DIR) 11 | 12 | # You can customize the name of your application .so file here. 13 | LOCAL_MODULE := rn069_appmodules 14 | 15 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 16 | LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) 17 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 18 | 19 | # If you wish to add a custom TurboModule or Fabric component in your app you 20 | # will have to uncomment those lines to include the generated source 21 | # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) 22 | # 23 | # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 24 | # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) 25 | # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 26 | 27 | # Here you should add any native library you wish to depend on. 28 | LOCAL_SHARED_LIBRARIES := \ 29 | libfabricjni \ 30 | libfbjni \ 31 | libfolly_runtime \ 32 | libglog \ 33 | libjsi \ 34 | libreact_codegen_rncore \ 35 | libreact_debug \ 36 | libreact_nativemodule_core \ 37 | libreact_render_componentregistry \ 38 | libreact_render_core \ 39 | libreact_render_debug \ 40 | libreact_render_graphics \ 41 | librrc_view \ 42 | libruntimeexecutor \ 43 | libturbomodulejsijni \ 44 | libyoga 45 | 46 | LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall 47 | 48 | include $(BUILD_SHARED_LIBRARY) 49 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | 5 | namespace facebook { 6 | namespace react { 7 | 8 | std::shared_ptr MainApplicationModuleProvider( 9 | const std::string moduleName, 10 | const JavaTurboModule::InitParams ¶ms) { 11 | // Here you can provide your own module provider for TurboModules coming from 12 | // either your application or from external libraries. The approach to follow 13 | // is similar to the following (for a library called `samplelibrary`: 14 | // 15 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 16 | // if (module != nullptr) { 17 | // return module; 18 | // } 19 | // return rncore_ModuleProvider(moduleName, params); 20 | return rncore_ModuleProvider(moduleName, params); 21 | } 22 | 23 | } // namespace react 24 | } // namespace facebook 25 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string name, 26 | const std::shared_ptr jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | std::string name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/Rn069/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string name, 25 | const std::shared_ptr jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(std::string name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/Rn069/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Rn069 3 | 4 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /examples/Rn069/android/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10.0.2.2 5 | localhost 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/Rn069/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henninghall/react-native-date-picker/1dcf1c147c14a7e7ab00995646b830ec6b91e9ce/examples/Rn069/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/Rn069/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /examples/Rn069/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Rn069' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | include(":ReactAndroid:hermes-engine") 10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') 11 | } -------------------------------------------------------------------------------- /examples/Rn069/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rn069", 3 | "displayName": "Rn069" 4 | } 5 | -------------------------------------------------------------------------------- /examples/Rn069/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../../package.json'); 3 | 4 | module.exports = { 5 | presets: [ 6 | ['module:metro-react-native-babel-preset'], 7 | ['@babel/preset-typescript', {allowDeclareFields: true}], // to allow use of declare context 8 | ], 9 | plugins: [ 10 | [ 11 | 'module-resolver', 12 | { 13 | extensions: ['.tsx', '.ts', '.js', '.json'], 14 | alias: { 15 | [pak.name]: path.join(__dirname, '../..', pak.source), 16 | }, 17 | }, 18 | ], 19 | ], 20 | }; 21 | -------------------------------------------------------------------------------- /examples/Rn069/config.ini: -------------------------------------------------------------------------------- 1 | hw.lcd.width=1080 2 | -------------------------------------------------------------------------------- /examples/Rn069/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './src/App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /examples/Rn069/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '12.4' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'Rn069' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | use_react_native!( 14 | :path => config[:reactNativePath], 15 | # to enable hermes on iOS, change `false` to `true` and then install pods 16 | :hermes_enabled => flags[:hermes_enabled], 17 | :fabric_enabled => flags[:fabric_enabled], 18 | # An absolute path to your application root. 19 | :app_path => "#{Pod::Config.instance.installation_root}/.." 20 | ) 21 | 22 | rn_date_picker_path = '../../..' 23 | pod 'react-native-date-picker', :path => rn_date_picker_path 24 | 25 | target 'Rn069Tests' do 26 | inherit! :complete 27 | # Pods for testing 28 | end 29 | 30 | # Enables Flipper. 31 | # 32 | # Note that if you have use_frameworks! enabled, Flipper will not work and 33 | # you should disable the next line. 34 | use_flipper!() 35 | 36 | post_install do |installer| 37 | react_native_post_install(installer) 38 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Rn069/ios/Rn069Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/Rn069/manual-tests/daylight-saving.md: -------------------------------------------------------------------------------- 1 | # Daylight saving testing 2 | 3 | I haven't found an automatic way to change the time on the emulator to be able to run these tests automatically. 4 | 5 | ## Test: AM/PM wheel should have proper values 6 | 7 | 1. Set the timezone to GMT-07:00 Pacific Standard Time. 8 | 1. Set the time to 2020-11-01 9 | 1. Set 24h setting to false. (AM/PM=true) 10 | 1. Go to time or datetime picker 11 | 1. Expect: Both AM and PM being in visible in AM/PM wheel. 12 | 13 | ## Test: Hour wheel should have proper values 14 | 15 | 1. Set the timezone to GMT-07:00 Pacific Standard Time. 16 | 1. Set the time to 2020-10-31 8:00 PM 17 | 1. Set 24h setting to false. (AM/PM=true) 18 | 1. Go to time or datetime picker. 19 | 1. Expect: All hours to exist on hour wheel and no hour missing. 20 | -------------------------------------------------------------------------------- /examples/Rn069/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const escape = require('escape-string-regexp'); 3 | const exclusionList = require('metro-config/src/defaults/exclusionList'); 4 | const pak = require('../../package.json'); 5 | 6 | const root = path.resolve(__dirname, '../..'); 7 | 8 | const modules = Object.keys({ 9 | ...pak.peerDependencies, 10 | }); 11 | 12 | module.exports = { 13 | projectRoot: __dirname, 14 | watchFolders: [root], 15 | 16 | // We need to make sure that only one version is loaded for peerDependencies 17 | // So we block them at the root, and alias them to the versions in example's node_modules 18 | resolver: { 19 | blacklistRE: exclusionList( 20 | modules.map( 21 | m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`), 22 | ), 23 | ), 24 | 25 | extraNodeModules: modules.reduce((acc, name) => { 26 | acc[name] = path.join(__dirname, 'node_modules', name); 27 | return acc; 28 | }, {}), 29 | }, 30 | 31 | transformer: { 32 | getTransformOptions: async () => ({ 33 | transform: { 34 | experimentalImportSupport: false, 35 | inlineRequires: true, 36 | }, 37 | }), 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /examples/Rn069/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rn069", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "pods": "(cd ios && bundle exec pod install)", 9 | "start": "react-native start", 10 | "test": "jest", 11 | "lint": "eslint .", 12 | "set-time-format": "adb shell settings put system time_12_24", 13 | "test:android": "yarn test:android-12h-mode && yarn test:android-24h-mode", 14 | "test:android:ci": "yarn test:android-12h-mode:ci && yarn test:android-24h-mode:ci", 15 | "emulator": "scripts/start-android-emulator.sh" 16 | }, 17 | "dependencies": { 18 | "react": "18.0.0", 19 | "react-native": "0.69.0" 20 | }, 21 | "devDependencies": { 22 | "@babel/core": "^7.12.9", 23 | "@babel/preset-typescript": "^7.18.6", 24 | "@babel/runtime": "^7.21.0", 25 | "@react-native-community/eslint-config": "^2.0.0", 26 | "babel-jest": "^28.1.2", 27 | "babel-plugin-module-resolver": "^4.1.0", 28 | "eslint": "^7.32.0", 29 | "jest": "^28.1.2", 30 | "metro-react-native-babel-preset": "^0.70.3", 31 | "react-test-renderer": "18.0.0" 32 | }, 33 | "jest": { 34 | "preset": "react-native" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/Rn069/react-native.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | dependencies: { 5 | 'react-native-date-picker': { 6 | root: path.join(__dirname, '../..'), 7 | }, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /examples/Rn069/src/PropButton.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import {Button} from 'react-native'; 3 | 4 | export const PropButton = ({title, value, onChange}) => ( 5 |