btime

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Up        key.Binding
	Right     key.Binding
	Down      key.Binding
	Left      key.Binding
	Backspace key.Binding
	Delete    key.Binding
	FocusPrev key.Binding
	FocusNext key.Binding
	Quit      key.Binding
}

KeyMap is the key bindings for different actions within the datepicker.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type Model

type Model struct {
	Time time.Time

	KeyMap   KeyMap
	Styles   Styles
	ShowHelp bool

	Focused bool
	// contains filtered or unexported fields
}

func New

func New(t time.Time) *Model

func (*Model) Blur

func (m *Model) Blur()

func (*Model) Focus

func (m *Model) Focus()

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) SetTime

func (m *Model) SetTime(t time.Time)

func (*Model) Update

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

func (*Model) Value

func (m *Model) Value() time.Time

func (*Model) View

func (m *Model) View() string

type Styles

type Styles struct {
	Selected   lipgloss.Style
	Unselected lipgloss.Style
	Separator  lipgloss.Style
	Help       lipgloss.Style
}

func DefaultStyles

func DefaultStyles() Styles

Jump to

Keyboard shortcuts

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