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

114
Views
Ordenar matriz con fechas de cadena (JavaScript)

Tengo este fragmento de código para ordenar:

 compareDates(a: string, b: string, isAsc: boolean) { // splitting the string after on dot, because the date string is like: 14.06.2022 var d1Splitted = a.split('.'); var d2Splitted = b.split('.'); const d1 = Date.parse(d1Splitted[2] + '-' + d1Splitted[1] + '-' + d1Splitted[0]); const d2 = Date.parse(d2Splitted[2] + '-' + d2Splitted[1] + '-' + d2Splitted[0]); return isAsc ? Number(d1) - Number(d2) : Number(d2) - Number(d1); }

Cuando clasifico una lista por fecha, obtengo la lista bien ordenada, pero después de hacer clic varias veces en el botón Ordenar, obtengo esto: ingrese la descripción de la imagen aquí

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!