showing results for - "react native date time picker modal"
Rafaela
04 Jan 2020
1import React, { useState } from "react";
2import { Button, View } from "react-native";
3import DateTimePickerModal from "react-native-modal-datetime-picker";
4
5const Example = () => {
6  const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
7
8  const showDatePicker = () => {
9    setDatePickerVisibility(true);
10  };
11
12  const hideDatePicker = () => {
13    setDatePickerVisibility(false);
14  };
15
16  const handleConfirm = (date) => {
17    console.warn("A date has been picked: ", date);
18    hideDatePicker();
19  };
20
21  return (
22    <View>
23      <Button title="Show Date Picker" onPress={showDatePicker} />
24      <DateTimePickerModal
25        isVisible={isDatePickerVisible}
26        mode="date"
27        onConfirm={handleConfirm}
28        onCancel={hideDatePicker}
29      />
30    </View>
31  );
32};
33
34export default Example;
queries leading to this page
react native modal datetime picker iosreact native modal datetime picker npmreact native modal datetime picker ios 14datetimepicker android react native modaldatetimepickermodal messed up react nativeimport datetimepickermodal from 27react native modal datetime picker 27 3breact native date time picker modaldatetimepicker from 27react native modal datetime pickernpm i react native modal datetime picker 40react native community 2fdatetimepickerreact natve modal date pickerdatepicker model react nativereact native react native datetimepicker modalreact native datetimepicker modalreact native modal datetime picker exampledate picker modal react nativereact native date range picker modalreact native modal datetime picker date formatreact native datepicker modalinstall react native modal datetime pickerreact native modal datetime picker secondsreact native modal datetime pickernpm i react native modal datetime pickernpm i react native modal datetie pickerreact native modal datetime picker formatnpm react native modal datetime pickerreact native date picker modalnpm install react native modal datetime pickerreact native datepicker modal examplereact native modal datetime picker npmreact native datetimepickermodal timereact native modal date pickerreact native datetimepicker modal ios 22react native datepicker 22react native datepicker modeldatetimepickermodal react nativedatetimepicker modal form react nativehow to use react native datetimepickermodalreact native modal picker date timereact native datetimepicker ios time picker on a modalreact native modal pickerdatetimepicker modal react nativereact native modal date pickerreact native modal datetime pickerreact native modal date time pickermodal datetime picker in react nativereact native modal date range pickerdatetimepicker react native modal datetime pickershow modal datetimepicker react nativereact native modal datetie picker npmreact native date time picker modal