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

173
Views
Cómo encontrar la diferencia entre dos fechas con formato dd/mm/yyyy en JavaScript en el cuadro de texto Keyup Event of date2

Tengo dos fechas en html Datefrom y Dateto texto de entrada con formato ddmmyyyy. Estoy tratando de averiguar la diferencia entre Datefrom y Dateto en el evento Keyup de Datefrom.

 <input type='text' asp-for="Datefrom " class="form-control " id="Datefrom " /> <input type='text' asp-for="Dateto " class="form-control " id="Dateto " />

Estoy tratando de encontrar la diferencia entre dos fechas en JavaScript como se indica a continuación. La diferencia no se muestra correctamente.

 <script> $("#Datefrom").datepicker({ format: 'dd/mm/yyyy', date: new Date(1900, 01, 01), autoclose: true, todayBtn: 'linked' }); $("#Dateto").datepicker({ format: 'dd/mm/yyyy', date: new Date(1900, 01, 01), autoclose: true, todayBtn: 'linked' }); $('#Datefrom ').keyup(function () { var stdatestring = $('#Datefrom').val(); var missdatestring = $('#Dateto').val(); var stdateval = moment(stdatestring, 'DD/MM/YYYY').toDate(); var datefromval = moment(missdatestring, 'DD/MM/YYYY').toDate(); var diffdate = missdatestring - stdatestring }); </script>
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!