module TimeBoss::Calendar::Waypoints::Absolute
Public Instance Methods
day(year_index, index)
click to toggle source
Get the specified day by index within the specified year. @param year_index [Integer] the year to examine @param index [Integer] the index of the day within the year @return [Calendar::Day]
# File lib/timeboss/calendar/waypoints/absolute.rb, line 45 def day(year_index, index) year(year_index).days[index - 1] end
day_for(date)
click to toggle source
Get the day that contains the specified date. @param date [Date] the date for which to locate the calendar day @return [Calendar::Day]
# File lib/timeboss/calendar/waypoints/absolute.rb, line 52 def day_for(date) Day.new(self, date) end
week(year_index, index)
click to toggle source
Get the specified week by index within the specified year. @param year_index [Integer] the year to examine @param index [Integer] the index of the week within the year @return [Calendar::Week]
# File lib/timeboss/calendar/waypoints/absolute.rb, line 30 def week(year_index, index) year(year_index).weeks[index - 1] end
week_for(date)
click to toggle source
Get the week that contains the specified date. @param date [Date] the date for which to locate the calendar week @return [Calendar::Week]
# File lib/timeboss/calendar/waypoints/absolute.rb, line 37 def week_for(date) year_for(date).weeks.find { |w| w.to_range.include?(date) } end