Калькулятор D-Day

Рассчитайте дни до срока, экзамена, поездки или события.

// about

Об этом инструменте

Расчёт D-Day сравнивает сегодняшний день с целевой датой и показывает, сколько календарных дней осталось или прошло.

Как использовать

  1. Выберите целевую дату.
  2. Нажмите «Рассчитать D-Day».
  3. Посмотрите количество оставшихся или прошедших дней.

Зачем используют этот инструмент

  • Полезно для сроков, экзаменов, поездок, дней рождения, запусков и встреч.
  • Чётко отличает будущие даты от уже прошедших.
  • Считает по календарным датам, не путая результат с часами и минутами.
Руководства · Дата и время · 8 мин чтения

Расчёт дат без ошибки на один день: обратный отсчёт, памятные даты, возраст и возраст в месяцах

Сколько дней до экзамена? Когда наступит сотый день? Сколько месяцев малышу? В расчётах дат на каждом шагу возникает разница в один день, поэтому важно знать, по какому правилу ведётся счёт.

В обратном отсчёте целевую дату обозначают D, день до неё — D-1, а следующий день — D+1. Оставшиеся дни — это просто целевая дата минус сегодня. 28 октября 2026 года до 25 декабря остаётся D-58.

Начало: 2026-03-01
Прошло дней: 2026-06-08 — через 99 дней после начала
День по счёту: 2026-06-08 — сотый день
Считать ли первый день: обратный отсчёт, памятные даты, возраст в годах и месяцах и концы месяцев без ошибки на один день.
Читать →
Сделать с ИИ

Создайте этот инструмент сами с помощью ИИ

Нужна своя версия? Скопируйте промпт в чат с ИИ или сохраните файл навыка для ИИ-агента. В них описаны функции, особые случаи и тесты, которые мы использовали.

Промпт и навык даны на английском — ИИ-инструменты хорошо его понимают.

Промпт-задание для ИИ

Вставьте как есть в Claude, ChatGPT или Gemini.

You are an experienced full-stack web developer. Build a web tool called "Калькулятор 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.md)

Сохраните как .claude/skills/build-d-day-calculator/SKILL.md, чтобы агенты вроде Claude Code использовали его при каждой доработке инструмента.

---
name: build-d-day-calculator
description: Use when building or changing a Калькулятор D-Day tool. Build a tool that shows the days remaining until, or elapsed since, a target date in D-day format.
---

# Build: Калькулятор 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

Советы по работе с ИИ

  • Укажите стек (React, Vue или чистый HTML) в первой строке, чтобы код подошёл к проекту.
  • Попросите ИИ выполнить перечисленные тесты и показать результаты до принятия кода.
  • Не вставляйте настоящие пароли, данные клиентов и API-ключи; используйте примеры.