Commit 1bc287fa authored by Kirill Smelkov's avatar Kirill Smelkov

fixup! X Draft support for date modifier

due:=XXX was not properly taken into account in e.g. `due:<=1m` filter.
parent 37dfac74
......@@ -43,6 +43,7 @@ class PostponeCommand(MultiCommand):
def _execute_multi_specific(self):
def _get_offset(p_todo):
# FIXME handle due modifiers
offset = p_todo.tag_value(
config().tag_due(), date.today().isoformat())
......@@ -75,7 +76,7 @@ class PostponeCommand(MultiCommand):
self.error("Warning: todo item has no (valid) start date, therefore it was not adjusted.")
# pylint: disable=E1103
todo.set_tag(config().tag_due(), new_due.isoformat())
todo.set_tag(config().tag_due(), new_due.isoformat()) # FIXME preserve due flags
self.todolist.dirty = True
self.out(self.printer.print_todo(todo))
......
......@@ -283,7 +283,16 @@ class OrdinalTagFilter(OrdinalFilter):
return resort_to_grep_filter()
try:
operand1 = date_string_to_date(p_todo.tag_value(self.key))
# due: and t: can have modifiers
if self.key == 'due':
_ = p_todo.due_date()
elif self.key == 't':
_ = p_todo.start_date()
else:
_ = date_string_to_date(p_todo.tag_value(self.key))
if _ is None:
raise ValueError
operand1 = _
operand2 = relative_date_to_date(self.value)
if not operand2:
......
......@@ -62,6 +62,7 @@ def advance_recurring_todo(p_todo, p_offset=None, p_strict=False):
raise NoRecurrenceException()
# pylint: disable=E1103
# FIXME preserve due modifiers
todo.set_tag(config().tag_due(), new_due.isoformat())
if todo.start_date():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment