perezd edited this page Sep 13, 2010 · 20 revisions
Clone this wiki locally

SmartMonth is a “bodysnatcher” plugin that takes boring Date month fixnums and replaces them with a rich toolkit of
functionality. You can use SmartMonth to:

  • Determine the first tuesday of any month in any year.
  • Determine all of the fridays of any month in any year.
  • Iterate through all the days of a month.
  • Determine how many days of the month there are.
  • Determine the first and last days of the month.
  • And other fun date/month related things!

This is designed to be an extension of not only Time.now.month, but adds a new Month class to the ruby object model.

Getting Started

SmartMonth does not require Ruby on Rails, you can simply require it and viola!

Here are some examples of the SmartMonth syntax:

Using Month iterators:


Read Rulesets for an extensive look at how the new rulesets engine works.

Plugin Enhancements and Todos

This is a list of ideas and enhancements I’d like to see integrated into SmartMonth. If you would like to help me make SmartMonth better, please feel free to fork my project and implement any of the following items:

  • Implement Rulesets for float/fixed dates and frequencies

If you have an idea for an enhancement or feature, please feel free to get in touch with me!


If you are interested in the inner workings of SmartMonth, please check the included RDoc Documentation or visit our documentation site ! Thank you!