Sha256: 951f7a04c7ef667f8d5ac50e6eeea76f21d82e220f70eaf072711629ce433f25

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

module GovernorHelper
  @@months = %w(January February March April May June July August September October November December)
  
  def render_plugin_partial(where, options = {})
    output = ""
    Governor::PluginManager.view_hooks[where].each do |f|
      opts = options.merge( {:file => f} )
      output << render(opts)
    end
    return output
  end
  
  def get_date_label
    if not params[:day].nil?
      "#{@@months[params[:month].to_i - 1]} #{params[:day]}, #{params[:year]}"
    elsif not params[:month].nil?
      "#{@@months[params[:month].to_i - 1]} #{params[:year]}"
    else
      params[:year]
    end
  end

  def show_time_ago(date)
    %{<acronym title="#{date.strftime '%A, %B %d, %Y at %I:%M %p'}">#{distance_of_time_in_words_to_now date}</acronym> ago}.html_safe
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
governor-0.1.1 app/helpers/governor_helper.rb
governor-0.1.0 app/helpers/governor_helper.rb