datetime

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the model for the datetime component

func New

func New(prompt string) Model

New creates a new datetime component

func (*Model) AdjustSegment

func (m *Model) AdjustSegment(delta int)

AdjustSegment increments or decrements the currently focused date-time segment.

func (*Model) Blur

func (m *Model) Blur()

Blur blurs the datetime component

func (*Model) CursorPosition

func (m *Model) CursorPosition() int

CursorPosition returns the cursor position in the editable timestamp.

func (*Model) Focus

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

Focus focuses the datetime component

func (*Model) FocusFirstSegment

func (m *Model) FocusFirstSegment()

FocusFirstSegment moves editing to the first date-time segment.

func (*Model) Focused

func (m *Model) Focused() bool

Focused returns true if the datetime component is focused

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the datetime component

func (*Model) LocalValue

func (m *Model) LocalValue() string

LocalValue returns the editable local timestamp string.

func (*Model) SetTime

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

SetTime sets the value of the datetime component

func (*Model) Time

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

Time returns the current time of the datetime component

func (Model) Update

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

Update updates the datetime component

func (*Model) Value

func (m *Model) Value() string

Value returns the current value of the datetime component

func (*Model) ValueUtc

func (m *Model) ValueUtc() string

ValueUtc returns the current value of the datetime component in UTC

func (Model) View

func (m Model) View() string

View returns the view of the datetime component

Jump to

Keyboard shortcuts

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