Date Finder plugin

Plugin details

Helper to find specific date or date range using various conditions.

Repositoryhttp://svn.viney.net.nz/things/rails/plugins/date_finder/ Author Jake Stetser Tags Date LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/date_finder/

Can find dates that match certain criteria. Eg:

The next three tuesdays:

    DateFinderBase.weekly.day(:tuesday).find(:max => 3)
  


The last Monday for the next three months:

    DateFinderBase.monthly.day(:monday).day_occurrence(:last).find(:max => 3)
  



You can string as many conditions together as you like:

  day(day) # A string (eg: friday), or an integer from 0 to 6 (0 = Sunday)
  day_number(number) # An integer, the day of the month.
  weekday # The day must be a weekday
  day_occurrence(type) # One of first, second, third, fourth, last. The day must be the given occurence in the month.
  month(month) # Like day, either a string or an integer from 1 to 12


The best form of documentation at the moment is the tests.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (2 older versions) | Last edited by: scott, 7 months ago