Sha256: 900ed256acc0494252e1d1c4a829403eb35bd45510eeb693be971cfcec16490d

Contents?: true

Size: 592 Bytes

Versions: 19

Compression:

Stored size: 592 Bytes

Contents

module MessageTrain
  # Application helper
  module ApplicationHelper
    def message_train_widget
      render partial: 'message_train/application/widget'
    end

    def fuzzy_date(date)
      time = Time.parse(date.strftime('%F %T'))
      case Time.now - time
      when 0..1.minute
        :just_now.l
      when 1.minute..1.day
        l(time, format: :fuzzy_today)
      when 1.day..1.week
        l(time, format: :fuzzy_this_week)
      when 1.week..1.year
        l(time, format: :fuzzy_date_without_year)
      else
        l(time, format: :fuzzy_date)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
message_train-0.6.17 app/helpers/message_train/application_helper.rb
message_train-0.6.16 app/helpers/message_train/application_helper.rb
message_train-0.6.15 app/helpers/message_train/application_helper.rb
message_train-0.6.14 app/helpers/message_train/application_helper.rb
message_train-0.6.13 app/helpers/message_train/application_helper.rb
message_train-0.6.12 app/helpers/message_train/application_helper.rb
message_train-0.6.11 app/helpers/message_train/application_helper.rb
message_train-0.6.10 app/helpers/message_train/application_helper.rb
message_train-0.6.9 app/helpers/message_train/application_helper.rb
message_train-0.6.8 app/helpers/message_train/application_helper.rb
message_train-0.6.7 app/helpers/message_train/application_helper.rb
message_train-0.6.6 app/helpers/message_train/application_helper.rb
message_train-0.6.5 app/helpers/message_train/application_helper.rb
message_train-0.6.4 app/helpers/message_train/application_helper.rb
message_train-0.6.3 app/helpers/message_train/application_helper.rb
message_train-0.6.2 app/helpers/message_train/application_helper.rb
message_train-0.6.1 app/helpers/message_train/application_helper.rb
message_train-0.6.0 app/helpers/message_train/application_helper.rb
message_train-0.5.3 app/helpers/message_train/application_helper.rb