Sha256: 461cc2a19f6e627e7a3eda9068b8590f361e920fbad91607b49c88a208d519d7
Contents?: true
Size: 630 Bytes
Versions: 25
Compression:
Stored size: 630 Bytes
Contents
module MessageTrain module ApplicationHelper def message_train_widget render partial: 'message_train/application/widget' end def fuzzy_date(date) time = Time.parse(date.strftime('%F %T')) # Don't get confused: ">" here means "after", not "more than" if time > 1.minute.ago :just_now.l elsif time > 1.day.ago l(time, format: :fuzzy_today) elsif time > 1.week.ago l(time, format: :fuzzy_this_week) elsif time > 1.year.ago l(time, format: :fuzzy_date_without_year) else l(time, format: :fuzzy_date) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems