Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
Getting date range to show true between 2 different years

I'm trying to get the months between 2 years, for example I have a project that starts on 2021-10-15 and it ends on 2022-05-03 and what I'm trying to do is get it to return true only for the months that is between those dates, so for example it would return true for oct, nov, dec, jan, feb, mar, apr, may.

The issue I have is that the way my code is it returns true but it goes from may - oct instead of oct - may.

Here is my code

dateRange(project, month){
    let startMonth = project.startDate.split('-')[1];
    let endMonth = project.endDate.split('-')[1];

    return month >= start_month && month <= end_month;
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda