lib/fiscal_year.rb
# The first day of the fiscal year of this Time object instance, based on the passed offset_month
The first day of the fiscal year of this Time object instance, based on the passed offset_month
The first day of the fiscal year of this Time object instance based on the passed offset_month
def beginning_of_fiscal_year(offset_month=1)
    if offset_month <= self.month
      self.change(
        :month => offset_month,
        :day => 1
      ).beginning_of_month
    else
      self.change(
        :month => offset_month,
        :day => 1,
        :year => self.year-1
      ).beginning_of_month
    end
  end
def beginning_of_fiscal_year ( offset_month = 1 ) if offset_month <= self . month self . change ( :month => offset_month , :day => 1 ) . beginning_of_month else self . change ( :month => offset_month , :day => 1 , :year => self . year - 1 ) . beginning_of_month end end
The first day of the fiscal year of this Time object instance, based on the passed offset_month
The first day of the fiscal year of this Time object instance based on the passed offset_month
# NOTE: we set the day to the 1st to avoid problems with end of month days that don't exist in all months. # For example, if it's March 31st, and we switch the month to February, the Time object will switch back to March # since February doesn't have a 31st day, and assumes it's March 1st/2nd (leapyear)
offset_month
<not_specific>