Centered monthly view

This commit is contained in:
steven carpenter 2025-07-28 22:33:42 -04:00
parent 0cb41d9cdf
commit 2476af323f
3 changed files with 11 additions and 2 deletions

View file

@ -25,7 +25,11 @@ func (m model) updateMonthView(msg tea.Msg) (tea.Model, tea.Cmd) {
m.daysInMonth = time.Date(m.year, time.Month(m.monthIndex+2), 0, 0, 0, 0, 0, time.UTC).Day()
switch msg := msg.(type) {
case tea.KeyMsg:
case tea.WindowSizeMsg:
m.width = msg.Width
m.height = msg.Height
case tea.KeyMsg:
switch msg.String() {
case "ctrl+c", "q":
return m, tea.Quit
@ -78,6 +82,8 @@ func (m model) updateMonthView(msg tea.Msg) (tea.Model, tea.Cmd) {
default:
return m, nil
}
return m, nil // ← This is the missing line
}
func (m model) updateHourlyView(msg tea.Msg) (tea.Model, tea.Cmd) {