summaryrefslogtreecommitdiff
path: root/calendar-cli.py
diff options
context:
space:
mode:
authorTobias Brox <t@tobixen.no>2015-05-17 20:55:35 +0200
committerTobias Brox <t@tobixen.no>2015-05-17 20:55:35 +0200
commitfea55cd46500148a61248488423f6492e13957fd (patch)
treebe8ade3ae61accea0cde03bc3eb88ec00f3bee7d /calendar-cli.py
parent78e95f1edb35f67ea6bcfc8883078727ae8027ff (diff)
downloadcalendar-cli-fea55cd46500148a61248488423f6492e13957fd.zip
only show start/due dates, not the time
Diffstat (limited to 'calendar-cli.py')
-rwxr-xr-xcalendar-cli.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index 74aa339..a7ce245 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -526,6 +526,8 @@ def todo_list(caldav_conn, args):
t['dtstart_passed_mark'] = '!' if _force_datetime(t['dtstart'], args) <= _now() else ' '
t['due'] = task.instance.vtodo.due.value if hasattr(task.instance.vtodo,'due') else date.today()+timedelta(365)
t['due_passed_mark'] = '!' if _force_datetime(t['due'], args) < _now() else ' '
+ for timeattr in ('dtstart', 'due'):
+ t[timeattr] = t[timeattr].strftime(args.timestamp_format)
for summary_attr in ('summary', 'location', 'description', 'url', 'uid'):
if hasattr(task.instance.vtodo, summary_attr):
t['summary'] = getattr(task.instance.vtodo, summary_attr).value
@@ -662,6 +664,7 @@ def main():
todo_list_parser.add_argument('--todo-template', help="Template for printing out the event", default="{dtstart}{dtstart_passed_mark} {due}{due_passed_mark} {summary}")
todo_list_parser.add_argument('--default-due', help="Default number of days from a task is submitted until it's considered due", default=14)
todo_list_parser.add_argument('--list-categories', help="Instead of listing the todo-items, list the unique categories used", action='store_true')
+ todo_list_parser.add_argument('--timestamp-format', help="strftime-style format string for the output timestamps", default="%F (%a)")
todo_list_parser.set_defaults(func=todo_list)
todo_edit_parser = todo_subparsers.add_parser('edit')