Skip to content

A fast, terminal-native date calculator and tracker written in Rust

License

fibnas/days-tui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

days-tui (ANSI)

Crates.io

License: MIT

A fast, terminal-native date calculator and tracker written in Rust using ratatui and crossterm. It handles everything from simple “days until” checks to storing your favorite dates and calculation history — all in glorious ANSI color.


Features

  • Calculator tab — Compute:

    • u → Days until a target date
    • s → Days since a date
    • b → Days between two dates
    • a → Add or subtract a number of days from a given date

    Save any result to your history with h.

  • Dates tab — Manage stored dates and history:

    • n → Add a new favorite date
    • d → Delete selected entry
    • c → Clear all entries (type “yes” to confirm)
    • f / h / a → Filter by favorites, history, or all
    • Arrow keys navigate through the list
  • Help tab — Built-in quick reference (?).

  • Persistent storage — All data is saved to a local entries.json in your working directory.

  • Offline and portable — No network dependencies; runs anywhere with a UTF-8 terminal.


Installation

Crates.io

Install:

cargo install days-tui
days-tui

OR

Make sure you have a recent Rust toolchain:

sudo dnf install rust cargo  # Fedora example

Then build and run:

git clone https://github.com/fibnas/days-tui.git
cd days-tui
cargo run --release

Controls

Key Context Action
Tab / Shift+Tab Global Switch tabs
q Global Quit
? Global Open Help
u / b / s / a Calculator Until / Between / Since / Add-Sub
h Calculator Save result to History
n Dates Add new favorite
d Dates Delete selected
c Dates Clear all entries
f Dates Show favorites only
h Dates Show history only
a Dates Show all
↑ / ↓ Dates Move selection
Esc Input mode Cancel current input
Enter Input mode Submit

File Structure

entries.json    ← Saved history & favorites
src/main.rs     ← Core TUI logic
Cargo.toml      ← Dependencies & metadata

Notes

  • Dates use ISO format: YYYY-MM-DD
  • Add/Sub accepts positive or negative integers
  • Each saved entry is tagged with:
    • username (whoami)
    • timestamp (RFC3339)
    • type (Favorite or History)

Preview

┌──────────────────────────────┐
│ days-tui (ANSI)              │
├──────────────────────────────┤
│ [Calculator] [Dates] [Help]  │
│                              │
│ Days until 2025-12-25: 67    │
│                              │
│ h: Save • q: Quit • ?: Help  │
└──────────────────────────────┘

Dependencies

  • ratatui — terminal UI framework
  • crossterm — cross-platform terminal control
  • serde + serde_json — JSON serialization
  • chrono — date handling
  • thiserror — friendly error types
  • whoami — grabs current user

License

MIT License © 2025 fibnas License: MIT

About

A fast, terminal-native date calculator and tracker written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages