Skip to content

Commit

Permalink
Switch order of setting start and due dates
Browse files Browse the repository at this point in the history
  • Loading branch information
rkhwaja committed Apr 23, 2024
1 parent 2174319 commit 1bae2e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/rtmilk/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,24 @@ async def _MirrorPropertyAsync(property_, value):
def _MirrorTask(task, taskData):
_MirrorProperty(task.tags, taskData.tags)
try:
_MirrorProperty(task.startDate, taskData.startDate)
# Move the due date first because you're more likely to be moving both dates to be later
_MirrorProperty(task.dueDate, taskData.dueDate)
_MirrorProperty(task.startDate, taskData.startDate)
except RTMError:
_MirrorProperty(task.dueDate, taskData.dueDate)
_MirrorProperty(task.startDate, taskData.startDate)
_MirrorProperty(task.dueDate, taskData.dueDate)
if taskData.complete is not None:
_MirrorProperty(task.complete, taskData.complete)

async def _MirrorTaskAsync(task, taskData):
await _MirrorPropertyAsync(task.tags, taskData.tags)
try:
await _MirrorPropertyAsync(task.startDate, taskData.startDate)
# Move the due date first because you're more likely to be moving both dates to be later
await _MirrorPropertyAsync(task.dueDate, taskData.dueDate)
await _MirrorPropertyAsync(task.startDate, taskData.startDate)
except RTMError:
await _MirrorPropertyAsync(task.dueDate, taskData.dueDate)
await _MirrorPropertyAsync(task.startDate, taskData.startDate)
await _MirrorPropertyAsync(task.dueDate, taskData.dueDate)
if taskData.complete is not None:
await _MirrorPropertyAsync(task.complete, taskData.complete)

Expand Down

0 comments on commit 1bae2e1

Please sign in to comment.