Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!