Skip to content

Commit

Permalink
exotui: clear lasterror when exiting calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
neutralinsomniac committed Apr 3, 2020
1 parent f9b118b commit b6e759a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/exotui/exotui.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ func (s *state) PickDateInteractive() {
for s.scanner.Scan() {
line := s.scanner.Text()
if len(line) == 0 {
s.lastError = ""
return
}
switch line[:1] {
Expand All @@ -443,6 +444,7 @@ func (s *state) PickDateInteractive() {
case "h":
currentDate = time.Now()
case "q":
s.lastError = ""
return
default:
// try to parse as day
Expand All @@ -454,6 +456,7 @@ func (s *state) PickDateInteractive() {
currentDate = time.Date(currentDate.Year(), currentDate.Month(), i, 0, 0, 0, 0, currentDate.Location())

s.GoToDate(currentDate)
s.lastError = ""
return
}

Expand Down

0 comments on commit b6e759a

Please sign in to comment.