Sha256: 6466559f402437d68eebf9f5ec0bb03c72bbb02add04c16ec8ecee1fb7d428c0

Contents?: true

Size: 636 Bytes

Versions: 28

Compression:

Stored size: 636 Bytes

Contents

class Pyk::Date
  
  #Pyk::Date.start_of_financial_year(d)
  def self.start_of_financial_year(d)
    Date.new((d.to_i - 1), 4, 1).to_time
  end

  #Pyk::Date.end_of_financial_year(d)
  def self.end_of_financial_year(d)
    Date.new(d.to_i, 3, 31).to_time + 86340
  end
  
  #Pyk::Date.end_of_month(month, year)
  def self.end_of_month(month, year)
    Date.new(year, month, -1).to_time + 86340
  end
  
  #Pyk::Date.next_month(month)
  def self.next_month(month)
    (month == 12) ? 1 : month + 1
  end
  
  #Pyk::Date.year_next_month(month, year)
  def self.year_next_month(month, year)
    (month == 12) ? year + 1 : year
  end
  
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pyk-0.3.2 lib/pyk/date.rb
pyk-0.3.1 lib/pyk/date.rb
pyk-0.3.0 lib/pyk/date.rb
pyk-0.2.9 lib/pyk/date.rb
pyk-0.2.8 lib/pyk/date.rb
pyk-0.2.7 lib/pyk/date.rb
pyk-0.2.6 lib/pyk/date.rb
pyk-0.2.5 lib/pyk/date.rb
pyk-0.2.3 lib/pyk/date.rb
pyk-0.2.2 lib/pyk/date.rb
pyk-0.2.1 lib/pyk/date.rb
pyk-0.2.0 lib/pyk/date.rb
pyk-0.1.9 lib/pyk/date.rb
pyk-0.1.8 lib/pyk/date.rb
pyk-0.1.6 lib/pyk/date.rb
pyk-0.1.5 lib/pyk/date.rb
pyk-0.1.4 lib/pyk/date.rb
pyk-0.1.3 lib/pyk/date.rb
pyk-0.1.2 lib/pyk/date.rb
pyk-0.1.1 lib/pyk/date.rb