31 lines
891 B
Go
31 lines
891 B
Go
package main
|
|
|
|
import tea "github.com/charmbracelet/bubbletea"
|
|
// viewMode is used to store which view is being currently seen (i.e. month or hour)
|
|
type viewMode int
|
|
|
|
const (
|
|
monthView viewMode = iota
|
|
hourlyView
|
|
)
|
|
|
|
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
|
|
|
|
// 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
|
|
}
|
|
|
|
//No init state
|
|
func (m model) Init() tea.Cmd {
|
|
return nil
|
|
}
|
|
|