Sha256: a3b198d18175ac332e2053c7170579021cb98491e372072a917ea2b6e147653d

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

module Drexed
  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
drexed-datetime-0.0.1 helpers/datetime_helper.rb