Hi
I'm using expo DateTimePicker, My issue is when I set the display to spinner, cancel and ok buttons are not displayed but I can see on other display mode.
Summary
The cancel & open button doesn't appear when display set of spinner
Reproducible sample code
import React, {useState} from 'react';
import {View, Button, Platform} from 'react-native';
import DateTimePicker from '@react-native-community/datetimepicker';
Cancel and Ok button can't show up because of style issue
Describe what you expected to happen:
Cancel and Ok button should add style option at for display spinner
Environment info
System:
OS: macOS 11.6
CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
Memory: 23.41 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.1.0 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK: Not Found
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
hello,
thanks for asking. With display=spinner you need to provide your own cancel / ok buttons. Neither UIDatePicker nor this package provide those buttons.
Bug report
Hi I'm using expo DateTimePicker, My issue is when I set the display to spinner, cancel and ok buttons are not displayed but I can see on other display mode.
Summary
The cancel & open button doesn't appear when display set of spinner
Reproducible sample code
import React, {useState} from 'react'; import {View, Button, Platform} from 'react-native'; import DateTimePicker from '@react-native-community/datetimepicker';
const App = () => { const [date, setDate] = useState(new Date(1598051730000)); const [mode, setMode] = useState('date'); const [show, setShow] = useState(false);
const onChange = (event, selectedDate) => { const currentDate = selectedDate || date; setShow(Platform.OS === 'ios'); setDate(currentDate); };
const showMode = (currentMode) => { setShow(true); setMode(currentMode); };
const showDatepicker = () => { showMode('date'); };
const showTimepicker = () => { showMode('time'); };
return (
); };
export default App;
Steps to reproduce
Cancel and Ok button can't show up because of style issue
Describe what you expected to happen:
Cancel and Ok button should add style option at for display spinner
Environment info
System: OS: macOS 11.6 CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz Memory: 23.41 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.1.0 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: Not Found SDKs: iOS SDK: Not Found Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: /undefined - /usr/bin/xcodebuild Languages: Java: 15.0.2 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
datetimepicker version: 3.5.2