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

116
Views
Cómo mostrar el número de domingos entre las fechas en la aplicación ReactJS

Estoy intentando crear una aplicación en ReactJS para mostrar la cantidad de domingos entre las fechas cuando haga clic en el botón Enviar. Tomé la fecha de inicio y la fecha de finalización como fecha de entrada y botón en un formulario. No puedo tener una idea de cómo incorporar en submitHandler y mostrar. A continuación se muestra mi código

 import React from 'react' import {useState} from 'react' const Calculate = () => { const [inputDate,setInputDate] = useState({ sdate:'', edate:'', }); const onChangeHandler = (e)=>{ let name =e.target.name let value = e.target.value const Calculate = () => { const [inputDate,setInputDate] = useState({ sdate:'', edate:'', }); const onChangeHandler = (e)=>{ let name =e.target.name let value = e.target.value setInputDate({...inputDate,[name]:value}) } const submitHandler=(e)=>{ e.preventDefault(); } return ( <div> <form action=""> <div> <div> <label htmlFor="">Start Date</label> <input type="date" name="sdate" onChange={onChangeHandler}/> </div> <div> <label htmlFor="">End Date</label> <input type="date" name="edate" onChange={onChangeHandler}/> </div> <button>Submit</button> </div> </form> </div> ) } export default Calculate <!-- end snippet --> setInputDate({...inputDate,[name]:value}) } const submitHandler=(e)=>{ e.preventDefault(); } return ( <div> <form action=""> <div> <div> <label htmlFor="">Start Date</label> <input type="date" name="sdate" onChange={onChangeHandler}/> </div> <div> <label htmlFor="">End Date</label> <input type="date" name="edate" onChange={onChangeHandler}/> </div> <button>Submit</button> </div> </form> </div> ) } export default Calculate

Buscando ayuda aquí. Gracias

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