34 lines
910 B
Go
34 lines
910 B
Go
package tui
|
|
|
|
import (
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
"github.com/charmbracelet/huh"
|
|
)
|
|
type viewMode int
|
|
|
|
const (
|
|
monthView viewMode = iota
|
|
hourlyView
|
|
formView
|
|
)
|
|
|
|
|
|
type model struct {
|
|
cursorRow int // which row the cursor is sitting on used for cursor highlight
|
|
cursorCol int // which col the cursor is sitiing on used for cursor highlight
|
|
monthIndex int // what month 1-12 that is being displayed
|
|
year int // the current year being displayed
|
|
startOffset int // weekday offset where day 1 starts
|
|
daysInMonth int // a count of how many days there are in the month to account for 30,31,or 28
|
|
|
|
mode viewMode
|
|
form *huh.Form
|
|
// For hourly view
|
|
selectedDay int // which day we are looking at in hourly view
|
|
hourCursor int // which hour (0-23) is selected in hourly view
|
|
}
|
|
|
|
|
|
func (m model) Init() tea.Cmd {
|
|
return nil
|
|
}
|