JSFiddle - React, Tailwind, and code Playground

by Rodrigo Portillo

JavaScript

var quinha = ["2021-06-30", "2021-06-20", "2021-06-21", "2021-06-22", "2021-06-23", "2021-06-24", "2021-06-25", "2021-06-26", "2021-06-15", "2021-06-27", "2021-06-16", "2021-06-17", "2021-06-28", "2021-06-18", "2021-06-29", "2021-06-19"];

quinha = quinha.sort((a, b) => {
  a = parseInt(a.replace(/\D/g, ""));
  b = parseInt(b.replace(/\D/g, ""));
  
  return a-b;
});

console.log(20210630 < 20210620);

console.log(quinha);