module Increments::Schedule

Constants

VERSION
WinterVacationSchedule

Public Instance Methods

foundation_anniversary?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 12
def foundation_anniversary?(date = Date.today)
  date.month == 2 && date.day == 29
end
holiday?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 47
def holiday?(date = Date.today)
  HolidayJapan.check(date)
end
pay_day?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 20
def pay_day?(date = Date.today)
  return work_day?(date) if date.day == 15
  return false if rest_day?(date)

  next_basic_pay_day = Date.new(date.year, date.month, 15)
  next_basic_pay_day = next_basic_pay_day.next_month if date > next_basic_pay_day
  date.next_day.upto(next_basic_pay_day).all? do |date_until_basic_pay_day|
    rest_day?(date_until_basic_pay_day)
  end
end
remote_work_day?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 35
def remote_work_day?(date = Date.today)
  date.wednesday? && work_day?(date)
end
rest_day?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 39
def rest_day?(date = Date.today)
  weekend?(date) || holiday?(date) || winter_vacation_day?(date)
end
super_hanakin?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 16
def super_hanakin?(date = Date.today)
  date.friday? && pay_day?(date)
end
weekend?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 43
def weekend?(date = Date.today)
  date.saturday? || date.sunday?
end
winter_vacation?(date = Date.today)
winter_vacation_day?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 51
def winter_vacation_day?(date = Date.today)
  WinterVacationSchedule.winter_vacation?(date)
end
Also aliased as: winter_vacation?
work_day?(date = Date.today) click to toggle source
# File lib/increments/schedule.rb, line 31
def work_day?(date = Date.today)
  !rest_day?(date)
end