Class: DateLabelHelper::ShowFromDateView

Inherits:
GenericDateView show all
Defined in:
app/helpers/date_label_helper.rb

Constant Summary

Constants inherited from GenericDateView

GenericDateView::COLORS

Instance Method Summary collapse

Methods inherited from GenericDateView

#date_html_wrapper, #date_mobile_html_wrapper, #days_from_today, #days_to_sym, #get_color, #initialize

Constructor Details

This class inherits a constructor from DateLabelHelper::GenericDateView

Instance Method Details

#show_from_date_htmlObject



118
119
120
# File 'app/helpers/date_label_helper.rb', line 118

def show_from_date_html
  date_html_wrapper { show_from_text }
end

#show_from_textObject



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'app/helpers/date_label_helper.rb', line 99

def show_from_text
  case @days_sym
  when :overdue_by_more_than_one, :overdue_by_one
    t('todos.scheduled_overdue', :days => @days * -1)
  when :today
    t('todos.show_today')
  when :tomorrow
    t('todos.show_tomorrow')
  when :this_week
    if @prefs.due_style == Preference.due_styles[:due_on]
      t('todos.show_on_date', :date => @date.strftime("%A"))
    else
      t('todos.show_in_days', :days => @days.to_s)
    end
  else
    t('todos.show_in_days', :days => @days.to_s)
  end
end