Class: Time
Constant Summary
WeekOfMonth::Constant::DAYS_IN_SEQUENCE, WeekOfMonth::Constant::MONTH_WITH_DAY, WeekOfMonth::Constant::MONTH_WITH_SEQUENCE, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_ENG, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_FR, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_GER, WeekOfMonth::Constant::WEEK_OF_MONTH_IN_JAP
Class Method Summary
collapse
Instance Method Summary
collapse
included
#beginning_of_week, #const, #current_week, #days_left_in_week, #days_past_in_week, #end_of_week, #first_week?, #general_week_of_month, #last_week?, #next_week, #previous_week, #second_week?, #total_weeks, #week_end?, #week_of_month, #week_split, #working_day?
#beginning_of_month, #day_name, #end_of_month, #last_day_of_month, #month_name, #name_of_month
#days_array, #name_of_week_day
Class Method Details
.new(year = Time.now.year, month = Time.now.month, day = Time.now.day, hour = Time.now.hour, min = Time.now.min, sec = Time.now.sec, millisecond = (Time.now.to_f * 1000.0).to_i) ⇒ Object
43
44
45
|
# File 'lib/week_of_month.rb', line 43
def self.new(year=Time.now.year, month=Time.now.month, day=Time.now.day, hour=Time.now.hour, min=Time.now.min, sec=Time.now.sec, millisecond=(Time.now.to_f * 1000.0).to_i)
Time.local(year, month, day, hour, min, sec, millisecond)
end
|
Instance Method Details
#friday? ⇒ Boolean
59
|
# File 'lib/week_of_month.rb', line 59
def friday? ; self.wday == 5; end
|
#leap? ⇒ Boolean
38
39
40
|
# File 'lib/week_of_month.rb', line 38
def leap?
self.to_date.leap?
end
|
#monday? ⇒ Boolean
55
|
# File 'lib/week_of_month.rb', line 55
def monday? ; self.wday == 1; end
|
#saturday? ⇒ Boolean
60
|
# File 'lib/week_of_month.rb', line 60
def saturday? ; self.wday == 6; end
|
#sunday? ⇒ Boolean
54
|
# File 'lib/week_of_month.rb', line 54
def sunday? ; self.wday == 0; end
|
#thursday? ⇒ Boolean
58
|
# File 'lib/week_of_month.rb', line 58
def thursday? ; self.wday == 4; end
|
#to_date ⇒ Object
49
50
51
|
# File 'lib/week_of_month.rb', line 49
def to_date
::Date.new(year, month, day)
end
|
#tuesday? ⇒ Boolean
56
|
# File 'lib/week_of_month.rb', line 56
def tuesday? ; self.wday == 2; end
|
#wednesday? ⇒ Boolean
57
|
# File 'lib/week_of_month.rb', line 57
def wednesday? ; self.wday == 3; end
|