class TimeBoss::Calendar::Day
Public Class Methods
new(calendar, start_date)
click to toggle source
Calls superclass method
# File lib/timeboss/calendar/day.rb, line 8 def initialize(calendar, start_date) super(calendar, start_date, start_date) end
Public Instance Methods
index()
click to toggle source
Get the index of this day within its containing year. @return [Integer]
# File lib/timeboss/calendar/day.rb, line 28 def index @_index ||= (start_date - year.start_date).to_i + 1 end
name()
click to toggle source
Get a simple representation of this day. @return [String] (e.g. “2020-08-03”)
# File lib/timeboss/calendar/day.rb, line 14 def name start_date.to_s end
Also aliased as: to_s
title()
click to toggle source
Get a “pretty” representation of this day. @return [String] (e.g. “August 3, 2020”)
# File lib/timeboss/calendar/day.rb, line 20 def title start_date.strftime("%B %-d, %Y") end
year_index()
click to toggle source
Get the year number for this day. @return [Integer] (e.g. 2020)
# File lib/timeboss/calendar/day.rb, line 34 def year_index @_year_index ||= year.year_index end
Private Instance Methods
down()
click to toggle source
# File lib/timeboss/calendar/day.rb, line 40 def down self.class.new(calendar, start_date - 1.day) end
up()
click to toggle source
# File lib/timeboss/calendar/day.rb, line 44 def up self.class.new(calendar, start_date + 1.day) end