Skip to content

ipiyer/calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fb-calender-puzzle

Given a list of start and end times, it uses interval tree to display the events in the calendar. Event are displayed in way that they don't overlap and uses the max available width.

Install & test

npm install
grunt test 

Solution

The challange is to use max available space for a given event. This solution is fairly simple and straighforward:

  • Use Interval tree to find overlapping events for every input event.
  • Compute width by substrating rendered width from total width and divde that event to render.
  • For every event scan from left 0 to find a hole to fit the event.

Demo

fb-calendar-puzzle.herokuapp.com

About

Event rendering calendar app, fb calendar puzzle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published