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

373
Vistas
How to position events in calendar correctly (left - width)

I am building a calendar component with react and javascript, but I am having problems on how to correctly position events on the week view. Every day of the week is a div (position:relative) in which I can place multiple div (position:absoulte) which are my events. To position the events I set top, height, left and width of the divs, no problems on setting top and height, but to set left and width I really have no clue on how to do it correctly to have a result like outlook calendar.

For now I came up with this: https://postimg.cc/jC9S9LyB

But what I am aiming for is this: https://postimg.cc/G99pqkTk

The 2 days marked as "test" should look the same, but as you can see I am struggling to find a way to correctly position overlapping events.

For each day I have an array with all the events of that day, here I can set all the parameters I need to position the events, then I render all the events.

Any idea on how to calculate left and width of the events to postion them correctly?

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