Sha256: 41731b56d8dab44e64250e4554c089b2e1fb9635e392f4a20953fc5feb17b7e5

Contents?: true

Size: 737 Bytes

Versions: 11

Compression:

Stored size: 737 Bytes

Contents

module Helpers
  def now
    Time.zone.now
  end

  def database_adapter
    REPORTS_KIT_DATABASE_ADAPTER
  end

  def format_configuration_time(time)
    ReportsKit::Reports::Data::Utils.format_configuration_time(time)
  end

  def format_csv_week_offset(week_offset)
    ReportsKit::Reports::Data::Utils.format_csv_time((now - week_offset.weeks).beginning_of_week(ReportsKit.configuration.first_day_of_week))
  end

  def format_day_offset(day_offset)
    ReportsKit::Reports::Data::Utils.format_display_time((now - day_offset.days))
  end

  def format_week_offset(week_offset)
    ReportsKit::Reports::Data::Utils.format_display_time((now - week_offset.weeks).beginning_of_week(ReportsKit.configuration.first_day_of_week))
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
reports_kits-0.7.8 spec/support/helpers.rb
reports_kits-0.7.7 spec/support/helpers.rb
reports_kit-0.7.1 spec/support/helpers.rb
reports_kit-0.7.0 spec/support/helpers.rb
reports_kit-0.5.0 spec/support/helpers.rb
reports_kit-0.4.1 spec/support/helpers.rb
reports_kit-0.4.0 spec/support/helpers.rb
reports_kit-0.3.3 spec/support/helpers.rb
reports_kit-0.3.2 spec/support/helpers.rb
reports_kit-0.3.1 spec/support/helpers.rb
reports_kit-0.3.0 spec/support/helpers.rb