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 da2cc84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rtmilk"
version = "1.0.3"
version = "1.0.4"
description = "RTM API wrapper"
authors = ["Rehan Khwaja <[email protected]>"]
license = "MIT"
Expand Down
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 da2cc84

Please sign in to comment.