Skip to content

lcc/bubble-datetime-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bubble-datetime-picker

This repository contains a Go implementation of a terminal-based hour selector model using the Bubble Tea framework. The model allows users to increment and decrement hours, minutes, and seconds, and navigate between them using keyboard input. It’s designed to be a simple and intuitive component for terminal user interfaces (TUIs).

Examples

datetime picker

Alt

hours picker

Alt

Installation

To install the package, run the following command:

go get github.com/lcc/bubble-datetime-picker

Usage

Import the Package

First, import the package in your Go project:

import (
    "github.com/lcc/bubble-datetime-picker"
)

Initialize the Model

You can initialize the dateAndHourModel and use it in your Bubble Tea application:

model := NewDateAndHourModel()

Example Code

Here’s a basic example of how to integrate the datetime picker into your Bubble Tea program:

package main

import (
    "fmt"
    tea "github.com/charmbracelet/bubbletea"
    dtPicker "github.com/lcc/bubble-datetime-picker"
)

func main() {
    p := tea.NewProgram(dtPicker.NewDateAndHourModel())
    if err := p.Start(); err != nil {
        fmt.Println("Error running program:", err)
    }
}

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgments

Special thanks to the Bubble Tea framework for providing an excellent foundation for building terminal UIs. A huge shoutout to Ethan Fung and his calendar UI for laying the groundwork that made this project possible. Your contributions have been invaluable in bringing this datetime picker to life.

About

Hour Selector TUI Component for bubbles framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages