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

220
Vistas
check if a date is between two dates in different years

I'm gonna use MomentJs or Dayjs to see if for instance Apr/03 is between Nov/01 and May/01.

When we try isBetween it doesn't work as in a year Nov/01 is not before Apr/03 but if you look at it as a two-year scop it should return true for moment('Apr/03').isBetween('Nov/01', 'May/01')

P.S. I cannot enter a year, for instance Apr/02/2021 is not an option.

Ok then, exports, what do you recommend?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I'm going to assume the earlier bound will always be in the first year and the later bound will always be in the second year, otherwise it is pretty much impossible.

moment('Apr/03').isAfter('Nov/01') || moment('Apr/03').isBefore('May/01')

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