WeeklyBuilder: A weekly calendar plugin for Rails
I implemented a scheduling system into an app this month and I needed a calendar with monthly and weekly views.
There are over 80 repo’s on github for calendar + ruby. Calendars in rails are a solved problem, right? But oddly I couldn’t find one with a weekly view. All of them are either date pickers or monthly calendars.
So I decided to build my own and I’m happy to announce my first plugin: WeeklyBuilder [Github | Live Demo]
The builder creates a horizontal scrolling calendar, mapping events for each day of the week. The layout is fluid CSS and the hours can be switched from business hours to 24 hours.
The code was inspired by table_builder by Petrik de Heus which is a clean way to generate monthly calenders.
How to Use WeeklyBuilder
First install by downloading the source from github or via command line:
The weekly calendar builder:
The Next/Previous link helper:
The controller code:
Example events model:
The event model only requires 2 attributes: starts_at:datetime and ends_at:datetime to calculate width and position on the calendar. To simplify this for the user, I only ask the user for one datetime (starts_at) and how long it will take to complete, it then calculates ends_at based on those 2 attributes.
Github: http://github.com/dmix/weekly_builder/
Example: http://scheduler.integratehq.com/
Note: The demo uses table_builder for the monthly view and includes a few extra styles on the weekly. Not yet tested on IE6.
Update (03/06): Added a truncate_width method so that long event names are truncated in proportion to the width of the event, this is passed through the week block: |event, truncate|.
- By Dan McGradyAdditional comments powered by BackType

Follow my RSS Feed
15 Comments
Looks awesome.
In fact it’s exactly what I need for a current project
WeeklyBuilder my first rails plugin released: http://bit.ly/FcHhC
This comment was originally posted on Twitter
Nice plugin Dan.
Surely will come handy.
Thank you. Thank you!
WeeklyBuilder: http://bit.ly/HqB9f looks interesting…
This comment was originally posted on Twitter
This seems pretty great, but isn’t this usually done the other way around? I’ve never seen a weekly view calendar that didn’t have the hours down the left hand side and the days across the top.
@Morgan Currie
In consumer calendars like iCal it’s often vertical. But I originally built it for a business app for field workers; in scheduling systems horizontal seems to be the standard.
Horizontal also works well for having multiple users instead of week days so you can see everyone’s calendar for a certain day on one page. I plan on adding that functionality soon.
That makes a lot of sense. Thanks for the quick reply!
WeeklyBuilder: A weekly calendar plugin for Rails http://bit.ly/4tckX
This comment was originally posted on Twitter
Using WeeklyBuilder and loving it http://bit.ly/4tckX
This comment was originally posted on Twitter
Nice UI. Good work.
@mrowe I wasn’t thinking management. I was looking at http://bit.ly/HqB9f and asking myself if I really want to be building those things?
This comment was originally posted on Twitter
WeeklyBuilder plugin is awesome http://bit.ly/FcHhC
This comment was originally posted on Twitter
@miamiphp Here’s a Rails calendar plugin for ya http://bit.ly/4tckX
This comment was originally posted on Twitter
I’ve played with this for the last couple of days and I quite like it. Will there be some documentation available sometime soon?
Also have you thought about planning to implement the ability to add recurring events?
All in all, great stuff!
2 Trackbacks
[...] WeeklyBuilder: A weekly calendar plugin for Rails | dMix | Dan McGrady – June 11th ( tags: calendar rails plugin ruby rubyonrails schedule weekly scheduling development ) [...]
[...] can also find calendar helpers for display such as http://dmix.ca/2009/06/weeklybuilder-a-weekly-calendar-plugin-for-rails/ or [...]