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

162
Visualizações
not able to get the time value and submited when date and time buttons are clicked

i am trying to make a booking without submit button i have many buttons to select a time and a date picker

i want data to be submited when date and time buttons are clicked

i am not able to get the time value also

var doctorid = props
const [dateState, setDateState] = useState(new Date());
  const changeDate = (e) => {
    setDateState(e);
  };
 function booking() {
 
    const data = {
      date: dateState,
      time: "12:pm",/// time button value must come here 
      doctor: doctorid,
    };


this is the jsx

<Calendar value={dateState} onChange={changeDate} />
             

 <TabPanel>
                  <button style={styles.button}>9:00am</button>
                  <button style={styles.button}>9:30am</button>
                  <button style={styles.button}>10:00am</button>
                  <button style={styles.button}>10:30am</button>
                  <button style={styles.button}>11:00am</button>
                  <button style={styles.button}>11:30am</button>
                  <button style={styles.button}>12:00pm</button>
  </TabPanel>
<TabPanel>
                  <button style={styles.button}>6:30pm</button>
                  <button style={styles.button}>7:00pm</button>
                  <button style={styles.button}>7:30pm</button>
                  <button style={styles.button}>8:00pm</button>
                </TabPanel>

i am not able to get the time value also

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

setDateState(e) should be setDateState(e.target.value);

about 4 years ago · Juan Pablo Isaza Relatório
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