Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add some API examples to the docs

  • Loading branch information...
commit 10a10a9d9aa34f27f754dedaed1dba224b24728f 1 parent 891cb84
@austinthecoder authored
Showing with 22 additions and 0 deletions.
  1. +22 −0
@@ -24,6 +24,28 @@ Cal is a simple calendar structure. It **does not** render a calendar. It **does
See the Rails app []( for an example.
+### API
+``` ruby
+calendar = 2012, 11, :start_week_on => :monday
+calendar.month # a Cal::Month
+calendar.first_day # a Cal::Day representing the first day on the calendar, might be in the previous month
+calendar.last_day # a Cal::Day representing the last day on the calendar, might be in the next month
+calendar.days # a Range of Cal::Day's from the first day to the last
+calendar.weeks # an Array of Cal::Day Arrays
+calendar.previous # the calendar for the previous month
+ # the calendar for the next month
+calendar.day_names # an Array of the day names, e.g. ['Sunday', 'Monday', ...], depends on the `:start_week_on` option
### Rails example
``` ruby
Please sign in to comment.
Something went wrong with that request. Please try again.