How to use mulitple date time pickers in a form react native functional approach. I'm using three datetime picker to get input
** I'm react learning react native when I'm selecting start time it shows booking time like that the time is not matching In three pickers two only working**
And the values are mismatching when selecting another picker component I cant find where the error occurs i've tried consolling step by step but got nothing
const handleConfirm = (date, event) => {
hideDatePicker();
console.log("event-------------->", event);
console.log("date-------------->", date);
event == 'startBid' ? startHandler(date) : event == 'endBid' ? endHandler(date) : event == 'bookingDate' ? BookingHandler(date) : null;
};
const showDatePicker = () => {
clearImmediate();
setDatePickerVisibility(true);
};
const hideDatePicker = () => {
setDatePickerVisibility(false);
};
const startHandler = (date) => {
console.log("startDate has been picked: ", date);
};
const endHandler = (date) => {
console.log("endDate has been picked: ", date);
};
const BookingHandler = (date) => {
console.log("bookingDate has been picked: ", date);
};
<Button title='akljfdhaskj' onPress={showDatePicker} />
<Button title='akljfdhaskj' onPress={showDatePicker} />
<DateTimePickerModal
key={1}
isVisible={isDatePickerVisible}
mode="datetime"
onChange={nyfyn}
onConfirm={date => {
handleConfirm(date, 'startBid')
console.log('startdate------>')
}}
onCancel={hideDatePicker}
/>
<Button title='124124124214' onPress={showDatePicker} />
<DateTimePickerModal
key={2}
isVisible={isDatePickerVisible}
mode="datetime"
onConfirm={date => {
handleConfirm(date, 'endBid')
console.log('endBid----------->')
}}
onCancel={hideDatePicker}
/>
<Button title='^o!!!@@@@@@!!!!!!!!!!!' onPress={showDatePicker}/>
<DateTimePickerModal
key={3}
isVisible={isDatePickerVisible}
mode="datetime"
onConfirm={date => {
handleConfirm(date, 'bookingDate')
console.log('bookingdate----------->')
}}
onCancel={hideDatePicker}
/>
How many English words
do you know?
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
how many words do you know
Powered by Examplum