Module RiCal::CoreExtensions::Time::WeekDayPredicates
In: lib/ri_cal/core_extensions/time/week_day_predicates.rb
  • ©2009 Rick DeNatale
  • All rights reserved. Refer to the file README.txt for the license
 Provide predicate and related methods for use by the RiCal gem
 This module is included by Time, Date, and DateTime

Methods

Public Instance methods

e.g. to obtain the 3nd Tuesday of the receivers month use

  time.nth_wday_in_month(2, 2)

A predicate to determine whether or not the receiver falls on a particular weekday of its month.

Parameters

n:the ordinal number being requested
which_wday:the weekday using Ruby time conventions, i.e. 0 => Sunday, 1 => Monday, …

Return a DateTime which is the beginning of the first day on or before the receiver with the specified wday

[Validate]