Calculadora D-Day

Calcula los días hasta una fecha límite, cumpleaños, viaje o evento.

// about

Sobre esta herramienta

El cálculo del D-Day compara hoy con una fecha objetivo e indica cuántos días naturales faltan o han pasado.

Cómo usarla

  1. Elige la fecha objetivo.
  2. Pulsa «Calcular D-Day».
  3. Consulta el número de días restantes o transcurridos.

Por qué usar esta herramienta

  • Útil para plazos, exámenes, viajes, cumpleaños, lanzamientos y citas.
  • Distingue claramente las fechas futuras de las que ya han pasado.
  • Usa fechas de calendario sin confundir el resultado con horas y minutos.
Guías · Fecha y hora · 8 min de lectura

Cálculo de fechas sin errores de un día: cuentas atrás, aniversarios, edad y meses de vida

¿Cuántos días faltan para el examen? ¿Cuándo es el día 100? ¿Cuántos meses tiene el bebé? Los cálculos de fechas están llenos de diferencias de un día, así que conviene saber qué regla se aplica.

La cuenta atrás llama D a la fecha objetivo, D-1 al día anterior y D+1 al siguiente. Los días que faltan son simplemente la fecha objetivo menos hoy. El 28 de octubre de 2026, el 25 de diciembre está a D-58.

Inicio: 2026-03-01
Días transcurridos: el 2026-06-08 está 99 días después del inicio
Número de día:      el 2026-06-08 es el día 100
Contar o no el primer día: cuentas atrás, aniversarios, cálculo de la edad, meses de vida y finales de mes sin errores de un día.
Leer guía →
Créalo con IA

Crea esta herramienta tú mismo con IA

¿Quieres tu propia versión? Copia el prompt en un chat de IA o guarda el archivo de skill para un agente de programación. Incluyen las funciones, casos límite y pruebas que usamos al crearla.

El prompt y la skill están en inglés, que las herramientas de IA entienden perfectamente.

Prompt de instrucciones para IA

Pégalo tal cual en Claude, ChatGPT o Gemini.

You are an experienced full-stack web developer. Build a web tool called "Calculadora D-Day" that meets the requirements below.

## Goal

Build a tool that shows the days remaining until, or elapsed since, a target date in D-day format.

## Core features

- Show D-n, D-Day or D+n for a target date
- Change the reference date
- 'Day number' mode that counts the first day
- Generate milestone lists such as day 100 or 1,000
- Copy the result sentence

## Inputs

- Target date
- Reference date (default today) and mode

## Outputs

- D-day label
- Days remaining or elapsed
- Milestone list

## Edge cases and handling rules

- Compare calendar dates only, not times
- Determine 'today' in the user's time zone
- Handle 29 February in leap years
- Show 'D-Day' when the target is today

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- From 2026-10-28, 2026-12-25 is D-58
- Day 100 from 2026-03-01 is 2026-06-08
- Same date shows D-Day

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Guárdalo como .claude/skills/build-d-day-calculator/SKILL.md para que agentes como Claude Code lo reutilicen cada vez que crees o cambies la herramienta.

---
name: build-d-day-calculator
description: Use when building or changing a Calculadora D-Day tool. Build a tool that shows the days remaining until, or elapsed since, a target date in D-day format.
---

# Build: Calculadora D-Day

## Goal

Build a tool that shows the days remaining until, or elapsed since, a target date in D-day format.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Show D-n, D-Day or D+n for a target date
- Change the reference date
- 'Day number' mode that counts the first day
- Generate milestone lists such as day 100 or 1,000
- Copy the result sentence

## Inputs

- Target date
- Reference date (default today) and mode

## Outputs

- D-day label
- Days remaining or elapsed
- Milestone list

## Rules

- Compare calendar dates only, not times
- Determine 'today' in the user's time zone
- Handle 29 February in leap years
- Show 'D-Day' when the target is today
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] From 2026-10-28, 2026-12-25 is D-58
- [ ] Day 100 from 2026-03-01 is 2026-06-08
- [ ] Same date shows D-Day

Consejos para trabajar con IA

  • Indica tu stack (React, Vue o HTML puro) en la primera línea para obtener código adecuado.
  • Pide que ejecute las pruebas listadas y muestre los resultados antes de aceptar el código.
  • No pegues contraseñas reales, datos de clientes ni claves de API; usa valores de ejemplo.