Dデー計算機

締切、試験、旅行、誕生日までの日数を計算します。

// about

ツールについて

Dデー計算は、今日と目標日を比べて、暦の上で何日残っているか、または何日過ぎたかを表示します。

使い方

  1. 目標日を選びます。
  2. 「Dデーを計算」を押します。
  3. 残り日数または経過日数を確認します。

このツールが使われる理由

  • 締切、試験、旅行、誕生日、リリース、予約の管理に便利です。
  • 未来の日付と過ぎた日付をはっきり区別して表示します。
  • 時間や分に惑わされず、暦の日付で計算します。
ガイド · 日付・時刻 · 4分で読めます

1日ずれない日付計算:カウントダウン、記念日、満年齢、月齢

試験まであと何日か。100日目はいつか。赤ちゃんは生後何か月か。日付計算は1日の差が生まれやすいので、どのルールで数えているのかを知っておくことが大切です。

D-dayの数え方では、目標日をD、その前日をD-1、翌日をD+1と呼びます。残り日数は単純に「目標日 − 今日」です。2026年10月28日から見ると、12月25日はD-58です。

開始日:2026-03-01
経過日数:2026-06-08 は開始日から99日後
何日目か:2026-06-08 は100日目
初日を数えるかどうかでカウントダウンや記念日の結果がどう変わるか、満年齢の計算方法、暦の月で数える月齢と月末の扱いを解説します。
ガイドを読む →
AIで作る

このツールをAIで自作してみましょう

自分用のバージョンが必要なら、作業指示プロンプトをAIチャットに貼り付けるか、スキルファイルをAIコーディングエージェントに保存してください。私たちが開発時に整理した機能、例外、テストケースが含まれています。

プロンプトとスキルは英語で提供しています。AIツールはどの言語でもよく理解できます。

AI作業指示プロンプト

Claude、ChatGPT、GeminiなどのAIチャットにそのまま貼り付けてください。

You are an experienced full-stack web developer. Build a web tool called "Dデー計算機" 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 CodeなどのAIコーディングエージェントで .claude/skills/build-d-day-calculator/SKILL.md に保存すると、このツールを作る・直すたびに再利用できます。

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

# Build: Dデー計算機

## 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

AIに任せるときのコツ

  • 最初の行に使用技術(React、Vue、素のHTMLなど)を書くと、プロジェクトに合ったコードになります。
  • コードを受け取る前に、テストケースを実行して結果を見せるよう依頼しましょう。
  • 本物のパスワード、顧客データ、APIキーは入力せず、サンプル値を使ってください。