出生月数卡片生成器

计算出生月数并下载带有可爱文字的图片。

// about

工具介绍

输入姓名和出生日期,即可生成按日历月份计算月龄的可爱卡片。灵感来自父母常对宝宝说的那句温馨话,即使数字变得很大也很有趣。

如何使用

  1. 输入姓名和出生日期。
  2. 选择参考日期,然后点击月龄按钮。
  3. 下载可爱的卡片,或复制句子进行分享。

人们为何使用此工具

  • 与家人朋友分享生日和月龄里程碑的有趣方式。
  • 同时生成可下载的图片和可复制的句子。
  • 卡片上会显示参考日期,结果一目了然。
指南 · 日期与时间 · 约 3 分钟

不差一天的日期计算:倒计时、纪念日、周岁与月龄

离考试还有几天?第 100 天是哪天?宝宝几个月大了?日期计算处处都可能差一天,所以要弄清楚用的是哪条规则。

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 "出生月数卡片生成器" that meets the requirements below.

## Goal

Build a tool that calculates age in calendar months from a name and birth date and creates a shareable card image.

## Core features

- Calendar-month age
- Choose the reference date (default today)
- Generate a sentence such as 'Alex is 18 months old'
- Download the card as SVG/PNG
- Copy the sentence

## Inputs

- Name
- Birth date
- Reference date

## Outputs

- Age in months
- Share sentence
- Card image

## Edge cases and handling rules

- Subtract one month if the reference day is before the birth day
- Error when the reference date is before the birth date
- Document the rule for birthdays on the 31st
- Keep the card layout intact with long names

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

- Born 1975-10-22, reference 2026-08-12 → 609 months
- Born 15 May: 0 months on 14 June, 1 month on 15 June
- The downloaded image contains the name and months

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-baby-age-calculator/SKILL.md,以后开发或修改此工具时可重复使用。

---
name: build-baby-age-calculator
description: Use when building or changing a 出生月数卡片生成器 tool. Build a tool that calculates age in calendar months from a name and birth date and creates a shareable card image.
---

# Build: 出生月数卡片生成器

## Goal

Build a tool that calculates age in calendar months from a name and birth date and creates a shareable card image.

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

- Calendar-month age
- Choose the reference date (default today)
- Generate a sentence such as 'Alex is 18 months old'
- Download the card as SVG/PNG
- Copy the sentence

## Inputs

- Name
- Birth date
- Reference date

## Outputs

- Age in months
- Share sentence
- Card image

## Rules

- Subtract one month if the reference day is before the birth day
- Error when the reference date is before the birth date
- Document the rule for birthdays on the 31st
- Keep the card layout intact with long names
- 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

- [ ] Born 1975-10-22, reference 2026-08-12 → 609 months
- [ ] Born 15 May: 0 months on 14 June, 1 month on 15 June
- [ ] The downloaded image contains the name and months

交给 AI 时的小技巧

  • 在第一行写明技术栈(如 React、Vue 或纯 HTML),生成的代码会更贴合你的项目。
  • 在接受代码前,请让 AI 运行列出的测试用例并展示结果。
  • 不要把真实密码、客户数据或 API 密钥粘贴到提示词中,请用示例值代替。