Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
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}
                    />

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda