Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
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 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!