Settings

Theme

Show HN: I'm created simple CLI-calendar without time.h

2 points by DenisDolya a month ago · 1 comment · 2 min read

Reader

TERMINAL CALENDAR APPLICATION

INTERACTIVE COMMAND-LINE CALENDAR WITH NAVIGATION

KEY FEATURES: - Monthly calendar display with highlighted current date - Navigation between months and years - Return to current date functionality - Leap year calculation - Recursive printing functions - Automatic current date detection

COMPILATION: gcc -o calendar calendar.c -Wall -O2

USAGE EXAMPLES: $ ./calendar

Initial display shows current month with today's date highlighted in brackets

NAVIGATION COMMANDS: n - Next month p - Previous month t - Today (return to current date) q - Quit application

DISPLAY FEATURES: - Month name and year in header with star borders - Day names (Su Mo Tu We Th Fr Sa) - Dates formatted in grid layout - Current date highlighted as [dd] - Automatic week wrapping

DATE HIGHLIGHTING: The current system date is automatically detected and highlighted using bracket notation: [15] for the 15th of current month

YEAR HANDLING: - Automatic leap year calculation for February - Smooth year transitions when navigating between December and January - Supports years based on system date capabilities

KEY FUNCTIONS: leap_year() - Determines if current year is leap year get_days() - Returns number of days in current month first_day() - Calculates day of week for 1st of month print_days() - Recursively prints calendar days with highlighting

GitHub: https://github.com/DenisDolya/cli-arsenal/tree/main/calendar

gus_massa a month ago

From the guidelines https://news.ycombinator.com/newsguidelines.html

> In Submissions

> Please don't do things to make titles stand out, like using uppercase or exclamation points

It's not explicit, but using allcaps in the text will make people unhappy and flag your post.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection