Project Suggestion: Calendar Tool

Abierto
#10,553 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
content

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
371k
Forks
45.3k
Merge medio
6 h 51 min
PR fusionados (30 d)
96

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nilbuild/developer-roadmap

Todos los issues de nilbuild/developer-roadmap

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.