Sha256: 4f7c52d2dc25fa24283e5d4d0203f5c9c4153d30414478355619e5d92ee611bb

Contents?: true

Size: 431 Bytes

Versions: 8

Compression:

Stored size: 431 Bytes

Contents

module ByStar
  module RangeCalculations

    private

    def start_of_year(year=Time.zone.now.year)
      Time.utc(year, 1, 1)
    end

    def end_of_year(year=Time.zone.now.year)
      start_of_year(year).end_of_year
    end

    def start_of_month(month, year=Timeow.year)
      Time.utc(year, month, 1)
    end

    def end_of_month(month, year=Time.now.year)
      start_of_month(month, year).end_of_month
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
by_star-1.0.1 lib/by_star/range_calculations.rb
by_star-1.0.0 lib/by_star/range_calculations.rb
by_star-0.9.0 lib/range_calculations.rb
by_star-0.8.0 lib/range_calculations.rb
by_star-0.7.2 lib/range_calculations.rb
by_star-0.7.1 lib/range_calculations.rb
by_star-0.7.0 lib/range_calculations.rb
by_star-0.6.4 lib/range_calculations.rb