Skip to content

Commit

Permalink
feat: better default for due
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Sep 30, 2024
1 parent ab4fd6c commit 348b989
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dooit/utils/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ def spacer():


def due_formatter(due, _):
if due == "none":
due = None
if not due or due == "none":
return ""

due = due or datetime.now()
return due.strftime("%H:%M")
text = due.strftime("%Y-%m-%d")

if due.hour:
text += f" ({due.strftime('%H:%M')})"

return text


def desc_formatter(desc: str, todo: Todo):
Expand Down

0 comments on commit 348b989

Please sign in to comment.