Module | RiCal::CoreExtensions::Time::Calculations |
In: |
lib/ri_cal/core_extensions/time/calculations.rb
|
Provide calculation methods for use by the RiCal gem This module is included by Time, Date, and DateTime
Convert the receivers wday to RFC 2445 format. Whereas the Ruby time/date classes use 0 to represent Sunday, RFC 2445 uses 7.
Return the date on which the first iso week with a given starting week day occurs for a given iso year
From RFC 2445 page 43: A week is defined as a seven day period, starting on the day of the week defined to be the week start (see WKST). Week number one of the calendar year is the first week which contains at least four (4) days in that calendar year.
year: | the iso year |
wkst: | an integer representing the day of the week on which weeks are deemed to start. This uses |
the ruby convention where 0 represents Sunday.
return the iso week number of the receiver
wkst: | an integer representing the day of the week on which weeks are deemed to start. This uses |
the ruby convention where 0 represents Sunday.
return the number of weeks in the the iso year containing the receiver
wkst: | an integer representing the day of the week on which weeks are deemed to start. This uses |
the ruby convention where 0 represents Sunday.
return the iso year of the receiver
wkst: | an integer representing the day of the week on which weeks are deemed to start. This uses |
the ruby convention where 0 represents Sunday.
Return an array containing the iso year and iso week number for the receiver. Note that the iso year may be the year before or after the calendar year containing the receiver.
wkst: | an integer representing the day of the week on which weeks are deemed to start. This uses |
the ruby convention where 0 represents Sunday.