mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 13:15:17 +01:00
Added clarsen's patch to prettify due dates for the range of 2-7 days away. There's a new setting in settings.yml.tmpl which you should add to your settings.yml. If due_style is set to 1, due dates in the 2-7 days away range will have the label, 'Due on Monday' (or whatever the corresponding day of the week it is). If set to 0, the behaviour will be as before (i.e. 'Due in 4 days').
Thanks clarsen! git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@173 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
d0a542f625
commit
2bd2d1928e
2 changed files with 9 additions and 2 deletions
|
|
@ -94,7 +94,7 @@ module TodoHelper
|
|||
|
||||
case @days
|
||||
# overdue or due very soon! sound the alarm!
|
||||
when -365..-1
|
||||
when -1000..-1
|
||||
"<a title='" + format_date(due) + "'><span class=\"red\">Overdue by " + (@days * -1).to_s + " days</span></a> "
|
||||
when 0
|
||||
"<a title='" + format_date(due) + "'><span class=\"amber\">Due Today</span></a> "
|
||||
|
|
@ -102,7 +102,11 @@ module TodoHelper
|
|||
"<a title='" + format_date(due) + "'><span class=\"amber\">Due Tomorrow</span></a> "
|
||||
# due 2-7 days away
|
||||
when 2..7
|
||||
"<a title='" + format_date(due) + "'><span class=\"orange\">Due in " + @days.to_s + " days</span></a> "
|
||||
if app_configurations["formats"]["due_style"] == 1
|
||||
"<a title='" + format_date(due) + "'><span class=\"orange\">Due on " + due.strftime("%A") + "</span></a> "
|
||||
else
|
||||
"<a title='" + format_date(due) + "'><span class=\"orange\">Due in " + @days.to_s + " days</span></a> "
|
||||
end
|
||||
# more than a week away - relax
|
||||
else
|
||||
"<a title='" + format_date(due) + "'><span class=\"green\">Due in " + @days.to_s + " days</span></a> "
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@
|
|||
# week_starts is the day you want the calendar to display first (0=Sunday, 1=Monday etc.)
|
||||
# hp_completed is the number of completed items you want displayed on the home page
|
||||
# staleness_starts is the number of days before actions start to go yellow with age!
|
||||
# due_style 0 is "due in N days" for N=2..7
|
||||
# due_style 1 is "due on weekdayname" for N=2..7
|
||||
#
|
||||
formats:
|
||||
date: %d/%m/%Y
|
||||
week_starts: 1
|
||||
hp_completed: 5
|
||||
staleness_starts: 7
|
||||
due_style: 0
|
||||
admin:
|
||||
email: butshesagirl@rousette.org.uk
|
||||
loginhash: change-me
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue