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



127
128
129
# File 'app/helpers/date_label_helper.rb', line 127

def show_from_date_html
  date_html_wrapper { show_from_text }
end

#show_from_textObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'app/helpers/date_label_helper.rb', line 108

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