Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

369
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda