| Crates.io | ccal |
| lib.rs | ccal |
| version | 0.1.1 |
| created_at | 2025-07-31 21:50:06.886214+00 |
| updated_at | 2025-08-01 20:19:33.257201+00 |
| description | Enhanced calendar with weekend coloring and weekday-only option |
| homepage | https://github.com/stephenyu/ColoredCal |
| repository | https://github.com/stephenyu/ColoredCal |
| max_upload_size | |
| id | 1775797 |
| size | 41,018 |
A fast, modern Rust implementation of an enhanced calendar tool that improves upon the standard Unix cal command with colored weekends, weekday-only display options, and flexible month viewing.
-w flag-m flag instead of full year viewcal command layout with visual enhancementsgit clone <repository-url>
cd ccal
cargo build --release
cargo install --path .
cargo run -- [OPTIONS] [YEAR]
ccal [OPTIONS] [YEAR]
-w, --weekdays: Show only weekdays (Monday-Friday)-m, --months [BEFORE] [AFTER]: Display months only (hides year). See examples below for usage patterns.-h, --help: Print help information-V, --version: Print version informationYEAR: Year to display (defaults to current year, ignored when using -m)-m flag)The -m flag provides flexible month viewing with intelligent year display:
-w: Works seamlessly with weekdays-only mode-m Usage Patterns:-m (no arguments): Show current month only-m X (one number): Show current month + X months after-m X Y (two numbers): Show X months before + current month + Y months after# Display current year with colored weekends
ccal
# Display 2024 with colored weekends
ccal 2024
# Display current year with weekdays only
ccal -w
# Display 2025 with weekdays only
ccal -w 2025
-m flag)# Show current month only
ccal -m
# Show current month + next month
ccal -m 1
# Show current month + next 2 months
ccal -m 2
# Show previous month + current + next month
ccal -m 1 1
# Show 2 months before + current + 1 month after
ccal -m 2 1
# Month view with weekdays only
ccal -m 3 -w
# Show current month through next 5 months (spans years)
ccal -m 5
# Using cargo run during development
cargo run -- -w 2024
cargo run -- -m 2 1
clap - Command line argument parsingchrono - Date and time handlingcolored - Terminal color outputThe Rust implementation provides three display modes:
-w flag): Displays only Monday through Friday, removing weekend columns entirely-m flag): Shows specific months without year header, with smart year labeling:
The calendar uses the chrono crate for accurate date calculations and colored for terminal styling, ensuring consistent behavior across different systems. Month calculations properly handle year transitions.
# Debug build
cargo build
# Release build (optimized)
cargo build --release
# Run tests
cargo test
# Run with arguments
cargo run -- --help
src/
├── main.rs # CLI interface and argument parsing
└── calendar.rs # Core calendar logic and display
This Rust implementation is significantly faster than shell script alternatives, with:
Feel free to submit issues or pull requests to improve the calendar tool!
This project is open source and available under the MIT OR Apache-2.0 license.