Added dynamic lists and fixed timezone issue

- **Today:** Display tasks of today and overdue
- **Tomorrow:** Tasks scheduled for tomorrow
- **Upcoming:** Tasks scheduled for next 7 days
- Keep "Today" focused on starting
- Order Tasks of dynamic list by Project
- Parsing date input using local TZ - Fixes #7
This commit is contained in:
Anis Ahmad
2020-07-04 16:48:45 +06:00
parent c1f11c3730
commit 1508edce6f
6 changed files with 102 additions and 14 deletions

View File

@@ -87,7 +87,8 @@ func (td *TaskDetailPane) makeDateRow() *tview.Flex {
SetDoneFunc(func(key tcell.Key) {
switch key {
case tcell.KeyEnter:
td.setTaskDate(parseDateInputOrCurrent(td.taskDate.GetText()).Unix(), true)
date := parseDateInputOrCurrent(td.taskDate.GetText())
td.setTaskDate(date.Unix(), true)
case tcell.KeyEsc:
td.setTaskDate(td.task.DueDate, false)
}
@@ -95,7 +96,7 @@ func (td *TaskDetailPane) makeDateRow() *tview.Flex {
})
todaySelector := func() {
td.setTaskDate(time.Now().Unix(), true)
td.setTaskDate(parseDateInputOrCurrent("").Unix(), true)
}
nextDaySelector := func() {
@@ -260,7 +261,7 @@ func (td *TaskDetailPane) editInExternalEditor() {
}
// @TODO: Mouse events not being captured after returning from Suspend - fix it
// app.EnableMouse(true).
app.EnableMouse(true)
_ = os.Remove(tmpFileName)
@@ -303,6 +304,7 @@ func (td *TaskDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey
case ' ':
td.toggleTaskStatus()
}
}
return event