Skip to content

Commit

Permalink
fix: tick
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed May 16, 2022
1 parent 1beac31 commit b39bfea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/ui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Quit
}
}
return m, nil
return m, tea.Every(time.Second, func(t time.Time) tea.Msg {
return t
})
}

var (
Expand All @@ -49,7 +51,7 @@ var (
func (m model) View() string {
s := header.Render("Hallo!") + "\n\n"
s += "Heute ist " + italic.Render(uhr.Weekday(m.t)) + ".\n"
s += "Es ist jetzt " + italic.Render(m.t.Format(time.Kitchen)) + ", aber du kannst auch sagen:\n"
s += "Es ist jetzt " + italic.Render(m.t.Format(time.Stamp)) + ", aber du kannst auch sagen:\n"
for _, l := range uhr.Uhr(m.t) {
s += list.Render("- ") + italic.Render(l) + "\n"
}
Expand Down

0 comments on commit b39bfea

Please sign in to comment.