Module: ApplicationHelper
- Defined in:
- lib/myrails/templates/rails/app/helpers/application_helper.rb
Instance Method Summary collapse
-
#long_date(date) ⇒ Object
Long date format.
-
#medium_date(date) ⇒ Object
Medium date format.
-
#medium_date2(date) ⇒ Object
Another style of medium date format.
-
#short_date(date) ⇒ Object
Short date format.
-
#us_date(date) ⇒ Object
US date format.
Instance Method Details
#long_date(date) ⇒ Object
Long date format
6 7 8 |
# File 'lib/myrails/templates/rails/app/helpers/application_helper.rb', line 6 def long_date(date) date.strftime("%A %d %B %Y - %H:%M %p") rescue 'unknown' end |
#medium_date(date) ⇒ Object
Medium date format
14 15 16 |
# File 'lib/myrails/templates/rails/app/helpers/application_helper.rb', line 14 def medium_date(date) date.strftime("%m/%d/%Y at %H:%M %p") rescue 'unknown' end |
#medium_date2(date) ⇒ Object
Another style of medium date format
Produces -> 18 October 2015
23 24 25 |
# File 'lib/myrails/templates/rails/app/helpers/application_helper.rb', line 23 def medium_date2(date) date.strftime("%d %B %Y") rescue 'unknown' end |
#short_date(date) ⇒ Object
Short date format
31 32 33 |
# File 'lib/myrails/templates/rails/app/helpers/application_helper.rb', line 31 def short_date(date) date.strftime("%Y-%m-%d") rescue 'unknown' end |
#us_date(date) ⇒ Object
US date format
39 40 41 |
# File 'lib/myrails/templates/rails/app/helpers/application_helper.rb', line 39 def us_date(date) date.strftime("%m/%d/%Y at %H:%M %p") rescue 'unknown' end |