dateinput

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputMode

type InputMode string

InputMode represents the type of date input

const (
	YearMode  InputMode = "Year"
	MonthMode InputMode = "Month"
	RangeMode InputMode = "Range"
)

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the state of the date input form

func NewModel

func NewModel(mode InputMode) Model

NewModel creates a new date input model

func (Model) Done

func (m Model) Done() bool

Done returns whether the form is done

func (Model) GetEndMonth

func (m Model) GetEndMonth() (*int, error)

GetEndMonth returns the entered end month

func (Model) GetEndYear

func (m Model) GetEndYear() (*int, error)

GetEndYear returns the entered end year

func (Model) GetMonth

func (m Model) GetMonth() (*int, error)

GetMonth returns the entered month

func (Model) GetYear

func (m Model) GetYear() (int, error)

GetYear returns the entered year

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles user input and updates the model

func (Model) View

func (m Model) View() string

View renders the UI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL