Project Suggestion: Calendar Tool

Aperta
#10,553 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
content

Direzione di ricerca

This is a project suggestion with no implementation files or tests identified. First inspect the repository’s contribution guidance and existing project suggestion issues to find where proposals belong and what format they use. Done means the proposal is accepted and scoped for this repository; implementing the full calendar tool requires design and a language choice that the issue does not specify.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Detailed Description

What is this project about?

The project consists of building a command-line calendar tool that allows users to perform date calculations, identify weekdays, and display monthly or yearly calendars.

The goal is to practice date manipulation, calendar algorithms, input validation, command-line argument handling, and formatted terminal output.

The project should implement Gregorian calendar calculations manually, without relying on built-in date/time libraries or external calendar dependencies.

Skills this Project Covers

  • Command-Line Interface (CLI)
  • Input Parsing and Validation
  • Date Arithmetic
  • Gregorian Calendar
  • Leap Year Calculation
  • Algorithm Design
  • Conditional Logic and Loops
  • Modular Programming
  • String Formatting

Requirements

Build a command-line program named calendar-tool that supports the following commands:

1. Weekday

Determine the day of the week for a given date.

Usage:

calendar-tool weekday YYYY-MM-DD

Example:

calendar-tool weekday 2026-11-08
# Output: sunday
2. Days

Support two date-related operations:

  • Calculate the ordinal day of the year when given a single date.
  • Calculate the signed number of days between two dates when given two dates.

Usage:

calendar-tool days YYYY-MM-DD
calendar-tool days YYYY-MM-DD YYYY-MM-DD

Example:

calendar-tool days 2026-11-08
# Output: 312th day of 2026

calendar-tool days 2026-11-08 2026-11-25
# Output: 17 days
3. Print Calendar

Display a formatted calendar for a specific month or an entire year.

Usage:

calendar-tool print YYYY-MM
calendar-tool print YYYY [columns]

Example:

calendar-tool print 2026-11
# Output: +----------------------------+
#         |       november 2026        |
#         | su  mo  tu  we  th  fr  sa |
#         |  1   2   3   4   5   6   7 |
#         |  8   9  10  11  12  13  14 |
#         | 15  16  17  18  19  20  21 |
#         | 22  23  24  25  26  27  28 |
#         | 29  30                     |
#         +----------------------------+

For yearly calendars:

  • Display all twelve months.
  • Use three columns by default.
  • Allow users to choose between one, two, or three columns.
  • Reject unsupported column values.
4. Help

Display available commands, their syntax, and a brief description of each operation.

Usage:

calendar-tool help
General Requirements
  • Use the Gregorian calendar.
  • Implement leap-year rules correctly, including century-year exceptions.
  • Validate dates, including month lengths and leap-year restrictions.
  • Handle invalid commands, missing arguments, and malformed dates gracefully.
  • Use a consistent date format: YYYY-MM-DD.
  • Implement calendar calculations, date validation, and weekday determination manually. Do not use built-in date/time libraries, external calendar libraries, or operating-system APIs for these operations.
  • Standard input/output and general-purpose string utilities are allowed.
Hints
  • The number of days in each month is fixed, except for February.
  • February has 28 days in a common year and 29 days in a leap year.
  • Consider how the total number of days elapsed since a reference date can be used to calculate date differences and weekdays.

I believe this project would be a good addition because it provides a practical way to learn date arithmetic and algorithm design while building a useful command-line application.

Lingua principale
TypeScript
Stelle
371k
Fork
45.3k
Merge medio
6h 51m
PR unite (30g)
96

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nilbuild/developer-roadmap

Tutte le issue di nilbuild/developer-roadmap

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.