Module: DateOutput

Defined in:
lib/date_output.rb,
lib/date_output/railtie.rb,
lib/date_output/version.rb,
lib/date_output/view_helpers.rb

Defined Under Namespace

Modules: ViewHelpers Classes: Railtie

Constant Summary collapse

VERSION =
"1.1.2"

Class Method Summary collapse

Class Method Details

.full_date(date, options) ⇒ Object



26
27
28
29
# File 'lib/date_output.rb', line 26

def self.full_date(date, options)
  set_options(options)
  date.strftime("%A #{date.day.ordinalize} %B %Y")
end

.full_date_with_time(date, options) ⇒ Object



6
7
8
9
# File 'lib/date_output.rb', line 6

def self.full_date_with_time(date, options)
  set_options(options)
  date.strftime("%A #{date.day.ordinalize} %B %Y %H:%M%P")
end

.long_date_no_day(date, options) ⇒ Object



36
37
38
39
# File 'lib/date_output.rb', line 36

def self.long_date_no_day(date, options)
  set_options(options)
  date.strftime("#{date.day.ordinalize} %B %Y")
end

.long_date_no_day_with_time(date, options) ⇒ Object



46
47
48
49
# File 'lib/date_output.rb', line 46

def self.long_date_no_day_with_time(date, options)
  set_options(options)
  date.strftime("#{date.day.ordinalize} %B %Y %H:%M%P")
end

.numbered_date(date, options) ⇒ Object



21
22
23
24
# File 'lib/date_output.rb', line 21

def self.numbered_date(date, options)
  set_options(options)
  date.strftime("%d#{@seperator}%m#{@seperator}%Y")
end

.numbered_date_with_time(date, options) ⇒ Object



16
17
18
19
# File 'lib/date_output.rb', line 16

def self.numbered_date_with_time(date, options)
  set_options(options)
  date.strftime("%d#{@seperator}%m#{@seperator}%Y %H:%M%P")
end

.short_date(date, options) ⇒ Object



31
32
33
34
# File 'lib/date_output.rb', line 31

def self.short_date(date, options)
  set_options(options)
  date.strftime("%a #{date.day.ordinalize} %b %y")
end

.short_date_no_day(date, options) ⇒ Object



41
42
43
44
# File 'lib/date_output.rb', line 41

def self.short_date_no_day(date, options)
  set_options(options)
  date.strftime("#{date.day.ordinalize} %b %y")
end

.short_date_no_day_with_time(date, options) ⇒ Object



51
52
53
54
# File 'lib/date_output.rb', line 51

def self.short_date_no_day_with_time(date, options)
  set_options(options)
  date.strftime("#{date.day.ordinalize} %b %y %H:%M%P")
end

.short_date_with_time(date, options) ⇒ Object



11
12
13
14
# File 'lib/date_output.rb', line 11

def self.short_date_with_time(date, options)
  set_options(options)
  date.strftime("%a #{date.day.ordinalize} %b %y %H:%M%P")
end