Feature #14642 » issue_14642_patch.diff
| config/locales/en.yml (working copy) | ||
|---|---|---|
|
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"
|
||
| app/helpers/queries_helper.rb (working copy) | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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)
|
||
- « Previous
- 1
- 2
- Next »