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

81
Vistas
How to work with upcoming events without year

I have a React native application with events where I have event dates in ISO format. I need to work with events on a yearly repeating basis. Events include dates like birthdays and also yearly events. I need to display upcoming events for the rest of the current year then display events for the next year. How to work with events without a year and sort by current date?

events.sort((a, b) => {
    const today = new Date();
    const currentYear = today.getFullYear();
    const dateA = new Date(a.date);
    dateA.setFullYear(currentYear);
    const dateB = new Date(b.date);
    dateB.setFullYear(currentYear);
    return dateA - dateB;
})
.filter(event => {
    const today = new Date();
    const currentYear = today.getFullYear();
    const eventDate = new Date(event.date);
    eventDate.setFullYear(currentYear);
    return eventDate > today;
})
.splice(0, 5)
.map(event => {
...
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