From 0751a54778b182bedf67eb62461f7b2495af856b Mon Sep 17 00:00:00 2001 From: Sebastian Wezel Date: Wed, 1 Feb 2023 16:00:03 +0100 Subject: [PATCH] task_detail: remove due date when string is empty Signed-off-by: Sebastian Wezel --- app/task_detail.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/task_detail.go b/app/task_detail.go index 40e3f7a..854cfd3 100644 --- a/app/task_detail.go +++ b/app/task_detail.go @@ -104,8 +104,12 @@ func (td *TaskDetailPane) makeDateRow() *tview.Flex { SetDoneFunc(func(key tcell.Key) { switch key { case tcell.KeyEnter: - date := parseDateInputOrCurrent(td.taskDate.GetText()) - td.setTaskDate(date.Unix(), true) + if td.taskDate.GetText() != "" { + date := parseDateInputOrCurrent(td.taskDate.GetText()) + td.setTaskDate(date.Unix(), true) + } else { + td.setTaskDate(0, true) + } case tcell.KeyEsc: td.setTaskDate(td.task.DueDate, false) }