class Date
Public Instance Methods
month_info()
click to toggle source
monthly information
@return [Hash]
# File lib/koyomi/helper/date.rb, line 59 def month_info _info = {} _infos = self.nth_wday.dup _info[:nth] = _infos.shift _info[:wday] = _infos.shift _info end
nth_month_week()
click to toggle source
nth week day of the month
@return [Integer]
# File lib/koyomi/helper/date.rb, line 43 def nth_month_week _week = (self.day / WEEK_DAYS).to_i _fraction = (self.day % WEEK_DAYS) (_week + (_fraction == 0 ? 0 : 1)) end
nth_wday()
click to toggle source
nth week, week day of the month
@return [Array] [<Integer>nth_month_week, <Symbol>wday_name]
# File lib/koyomi/helper/date.rb, line 52 def nth_wday [self.nth_month_week, self.wday_name] end
wday_name()
click to toggle source
week day name
@return [Symbol]
# File lib/koyomi/helper/date.rb, line 36 def wday_name self.class.wday_name(self) end
week_end?(week_start = nil)
click to toggle source
check week end?
@param [Object] week_start @return [Boolean]
# File lib/koyomi/helper/date.rb, line 14 def week_end?(week_start = nil) self.class.week_ends?(self, week_start) end
week_start?(week_start = nil)
click to toggle source
check week start?
@param [Object] week_start @return [Boolean]
# File lib/koyomi/helper/date.rb, line 22 def week_start?(week_start = nil) self.class.week_starts?(self, week_start) end
windex()
click to toggle source
week day index
@return [Integer]
# File lib/koyomi/helper/date.rb, line 29 def windex self.class.windex(self) end