mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-04 06:51:48 +01:00
move overdue actions to today in the ics calendar and mark them as overdue
as suggested by Hans de Graaff on the mailing list
This commit is contained in:
parent
7b90c00d84
commit
f5c50d367e
1 changed files with 15 additions and 9 deletions
|
|
@ -4,22 +4,28 @@ VERSION:2.0
|
|||
CALSCALE:GREGORIAN
|
||||
METHOD:PUBLISH
|
||||
X-WR-CALNAME:Tracks
|
||||
<% for todo in @due_all -%>
|
||||
BEGIN:VEVENT
|
||||
DTSTART;VALUE=DATE:<%= todo.due.strftime("%Y%m%d") %>
|
||||
DTEND;VALUE=DATE:<%= (todo.due+1.day).strftime("%Y%m%d") %>
|
||||
DTSTAMP:<%= todo.due.strftime("%Y%m%dT%H%M%SZ") %>
|
||||
<% for todo in @due_all
|
||||
due_date = todo.due
|
||||
overdue_text = ""
|
||||
if due_date < Time.zone.now
|
||||
due_date = Time.zone.now
|
||||
overdue_text = "Overdue: "
|
||||
end
|
||||
%>BEGIN:VEVENT
|
||||
DTSTART;VALUE=DATE:<%= due_date.strftime("%Y%m%d") %>
|
||||
DTEND;VALUE=DATE:<%= (due_date+1.day).strftime("%Y%m%d") %>
|
||||
DTSTAMP:<%= due_date.strftime("%Y%m%dT%H%M%SZ") %>
|
||||
UID:<%= todo_url(todo) %>
|
||||
CLASS:PUBLIC
|
||||
CATEGORIES:Tracks
|
||||
CREATED:<%= todo.created_at.strftime("%Y%m%dT%H%M%SZ") %>
|
||||
DESCRIPTION:<%= format_ical_notes(todo.notes) %>
|
||||
LAST-MODIFIED:<%= todo.due.strftime("%Y%m%dT%H%M%SZ") %>
|
||||
LAST-MODIFIED:<%= due_date.strftime("%Y%m%dT%H%M%SZ") %>
|
||||
LOCATION:
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:<%= todo.description %>
|
||||
SUMMARY:<%= overdue_text + todo.description %>
|
||||
TRANSP:TRANSPARENT
|
||||
END:VEVENT
|
||||
<% end -%>
|
||||
END:VCALENDAR
|
||||
<% end
|
||||
%>END:VCALENDAR
|
||||
Loading…
Add table
Add a link
Reference in a new issue