Module: DateBook::ApplicationHelper
- Defined in:
- app/helpers/date_book/application_helper.rb
Overview
Global helpers, used mostly to format dates smartly
Instance Method Summary collapse
- #date_book_date(date, all_day = false) ⇒ Object
- #date_book_date_range(start_date, end_date, all_day, duration) ⇒ Object
- #date_book_scripts ⇒ Object
- #date_book_time(date) ⇒ Object
Instance Method Details
#date_book_date(date, all_day = false) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/helpers/date_book/application_helper.rb', line 19 def date_book_date(date, all_day = false) format = if all_day :human_date else :human_datetime end I18n.localize date, format: format end |
#date_book_date_range(start_date, end_date, all_day, duration) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/helpers/date_book/application_helper.rb', line 10 def date_book_date_range(start_date, end_date, all_day, duration) render partial: 'date_book/application/date_range', locals: { start_date: start_date, end_date: end_date, all_day: all_day, duration: duration } end |
#date_book_scripts ⇒ Object
6 7 8 |
# File 'app/helpers/date_book/application_helper.rb', line 6 def date_book_scripts render partial: 'layouts/date_book_scripts' end |
#date_book_time(date) ⇒ Object
28 29 30 |
# File 'app/helpers/date_book/application_helper.rb', line 28 def date_book_time(date) I18n.localize date, format: :human_time end |