Displaying and updating Due Date

This commit is contained in:
Anis Ahmad
2020-05-30 12:36:14 +06:00
parent 30cd7f40a1
commit 9a6d3c6b30
3 changed files with 60 additions and 26 deletions

View File

@@ -35,6 +35,15 @@ func makeLightTextInput(placeholder string) *tview.InputField {
SetFieldBackgroundColor(tcell.ColorGray)
}
// If input text is a valid date, parse it. Or get current date
func parseDateInputOrCurrent(inputText string) time.Time {
if date, err := time.Parse(dateLayoutISO, inputText); err == nil {
return date
} else {
return time.Now()
}
}
func showMessage(text string) {
message.SetText(text)
statusBar.SwitchToPage(messagePage)