Class: DateLabelHelper::DueDateView
Constant Summary
GenericDateView::COLORS
Instance Method Summary
collapse
#date_html_wrapper, #date_mobile_html_wrapper, #days_from_today, #days_to_sym, #get_color, #initialize
Instance Method Details
#due_date_html ⇒ Object
89
90
91
|
# File 'app/helpers/date_label_helper.rb', line 89
def due_date_html
date_html_wrapper { due_text }
end
|
#due_date_mobile_html ⇒ Object
93
94
95
|
# File 'app/helpers/date_label_helper.rb', line 93
def due_date_mobile_html
date_mobile_html_wrapper { @prefs.format_date(@due) }
end
|
#due_text ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# File 'app/helpers/date_label_helper.rb', line 67
def due_text
case @days_sym
when :overdue_by_one
t('todos.next_actions_due_date.overdue_by', :days => @days * -1)
when :overdue_by_more_than_one
t('todos.next_actions_due_date.overdue_by_plural', :days => @days * -1)
when :today
t('todos.next_actions_due_date.due_today')
when :tomorrow
t('todos.next_actions_due_date.due_tomorrow')
when :this_week
if @prefs.due_style == Preference.due_styles[:due_on]
t('models.preference.due_on', :date => @date.strftime("%A"))
else
t('models.preference.due_in', :days => @days)
end
else
t('models.preference.due_in', :days => @days)
end
end
|