Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/duffy/date.rb

Instance Method Summary collapse

Instance Method Details

#fiscal_yearObject

Return the fiscal year for a given date. See config to set the start of your fiscal year. Example: Date.new(2015,10,1).fiscal_year => 2016



6
7
8
# File 'lib/duffy/date.rb', line 6

def fiscal_year
  (self < Date.new(year, Duffy.configuration.fiscal_month, Duffy.configuration.fiscal_day)) ? year : year + 1
end