Sha256: a551dc861821511404bd14e2a3ea94a2edf1973488371229827c9a2d8171b408

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

module DatetimeHelper

  def month_day_and_time_for(tach)
    unless tach.blank?
      tach.strftime("%B %e at %I:%M %p")
    end
  end

  def date_time_for(tach)
    unless tach.blank?
      tach.strftime("%B %e, %Y at %I:%M %p")
    end
  end

  def date_for(tach)
    unless tach.blank?
      tach.strftime("%B %e, %Y")
    end
  end

  def twenty_four_hour_time_for(tach)
    unless tach.blank?
      tach.strftime("%H:%M")
    end
  end

  def twelve_hour_time_for(tach)
    unless tach.blank?
      tach.strftime("%I:%M %p")
    end
  end

  def month_name_for(tach)
    unless tach.blank?
      tach.strftime("%B")
    end
  end

  def abbr_month_name_for(tach)
    unless tach.blank?
      tach.strftime("%b")
    end
  end

  def day_name_for(tach)
    unless tach.blank?
      tach.strftime("%A")
    end
  end

  def day_number_for(tach)
    unless tach.blank?
      tach.strftime("%e")
    end
  end

  def abbr_day_name_for(tach)
    unless tach.blank?
      tach.strftime("%a")
    end
  end

  def abbr_month_and_day_for(tach)
    unless tach.blank?
      tach.strftime("%b %d")
    end
  end

  def abbr_date_for(tach)
    unless tach.blank?
      tach.strftime("%b %d, %Y")
    end
  end

  def abbr_date_time(tach)
    unless tach.blank?
      tach.strftime("%b %d, %Y at %I:%M %p")
    end
  end

  def timezone_name_for(tach)
    unless tach.blank?
      tach.strftime("%Z")
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
drexed-datetime-0.0.4 app/helpers/datetime_helper.rb
drexed-datetime-0.0.2 app/helpers/datetime_helper.rb