Class DateGen
In: lib/vpim/date.rb
Parent: Object

DateGen generates arrays of dates matching simple criteria.

Methods

Public Class methods

Generate an array of dates on mday (the day-of-month, 1-31). For months in which the mday is not present, no date will be generated.

The period is a year, unless month is non-nil, in which case it is just that month.

Compare to Date.new(), which allows a single Date to be created with similar criteria.

Generate an array of dates on wday (the day-of-week, 0-6, where 0 is Sunday).

If n is specified, only the nth occurrence of wday within the period will be generated. If n is positive, the nth occurrence from the beginning of the period will be returned, if negative, the nth occurrence from the end of the period will be returned.

The period is a year, unless month is non-nil, in which case it is just that month.

Examples:

Compare to Date.bywday(), which allows a single Date to be created with similar criteria.

Generate an array of a week‘s dates, where week is specified by year, mon, day, and the weekstart (the day-of-week that is considered the "first" day of that week, 0-6, where 0 is sunday).

[Validate]