Index: config/locales/en.yml =================================================================== --- config/locales/en.yml (revision 12119) +++ config/locales/en.yml (working copy) @@ -673,6 +673,7 @@ label_today: today label_all_time: all time label_yesterday: yesterday + label_tomorrow: tomorrow label_this_week: this week label_last_week: last week label_last_n_weeks: "last %{count} weeks" Index: app/helpers/queries_helper.rb =================================================================== --- app/helpers/queries_helper.rb (revision 12119) +++ app/helpers/queries_helper.rb (working copy) @@ -88,6 +88,26 @@ column_value(column, issue, value) end end + + def format_date_yesterday_today_tomorrow(value) + today = Time.now + yesterday = Time.now - 60*60*24 + tomorrow = Time.now + 60*60*24 + if today.year == value.year and today.month == value.month and today.day == value.day + l:label_today + elsif yesterday.year == value.year and yesterday.month == value.month and yesterday.day == value.day + l:label_yesterday + elsif tomorrow.year == value.year and tomorrow.month == value.month and tomorrow.day == value.day + l:label_tomorrow + else + case value.class.name + when 'Time' + format_time(value) + when 'Date' + format_date(value) + end + end + end def column_value(column, issue, value) case value.class.name @@ -99,10 +119,8 @@ else h(value) end - when 'Time' - format_time(value) - when 'Date' - format_date(value) + when 'Time', 'Date' + format_date_yesterday_today_tomorrow(value) when 'Fixnum' if column.name == :id link_to value, issue_path(issue)