Dashing widget to display first two coming-up Google Calendar events.
Basically, you do not need more than two events on your dashboard, but it can be easily extended to the neighboring cells and show, say, 4 events instead of 2.
This is an alternative to existing widget, designed by @designoid, that allows you to display an event (1 event per widget). In contrast, this widget shows all the events in one place (1 calendar per widget).
For each calendar, Dashing job fetches the events of it using provided uri, orders events to match starting time and sends the data to the dashboard.
In our company, we use it to track internal events (e.g. meetings and presentations).
You'll need icalendar for handling ics
data. Go ahead and add gem 'icalendar'
to your Gemfile
. Then run bundle install
.
Download MomentJS and put moment.min.js
in your /assets/javascripts
directory. It gets included automatically.
The files google_calendar.coffee
, google_calendar.html
and google_calendar.scss
go in the /widget/google_calendar
directory.
The google_calendar.rb
goes in the /jobs
directory.
Open it and add calendars you want to track. You'll have to give a name and uri for each of them. Notice that uri should return data in RFC-2445
format (see icalendar readme for details). You might also change how often job is called to suit your needs.
Finally, add the following block to your dashingboard.erb file for each calendar:
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
<div data-id="google_calendar_<calendar_name>" data-view="GoogleCalendar" style="background-color:#4183C5;"></div>
<i class="icon-calendar icon-background"></i>
</li>
Replace <calendar_name> with the calendar's name.
Added a calendar using the suggested format in the rb file:
No calendar loads, even a public one with test event.
Thoughts?