{"skill":{"slug":"chinese-calendar","displayName":"中国日历","summary":"获取中国日历信息，包括节假日、调休安排、工作日判断。使用 timor.tech API，数据每年自动更新。Use when: 需要判断某天是否是工作日、查询节假日安排、了解调休情况。","description":"---\nname: chinese-calendar\ndescription: \"获取中国日历信息，包括节假日、调休安排、工作日判断。使用 timor.tech API，数据每年自动更新。Use when: 需要判断某天是否是工作日、查询节假日安排、了解调休情况。\"\nmetadata: { \"openclaw\": { \"emoji\": \"📅\", \"requires\": { \"bins\": [\"curl\"] } } }\n---\n\n# Chinese Calendar Skill\n\n获取中国日历信息，包括节假日、调休安排、工作日判断。\n\n## When to Use\n\n✅ **USE this skill when:**\n\n- 判断某天是否是工作日（考虑调休）\n- 查询节假日安排\n- 了解调休补班情况\n- 生成工作日历提醒\n\n❌ **DON'T use this skill when:**\n\n- 只需要普通日期计算 → use built-in date tools\n- 需要农历信息 → use lunar calendar tools\n- 需要其他国家节假日 → use international calendar APIs\n\n## API Source\n\n使用 **timor.tech** 提供的免费 API：\n- 数据每年自动更新\n- 包含国务院发布的节假日安排\n- 包含调休、补班信息\n\n## Commands\n\n### 查询某天是否是工作日\n\n```bash\n# 查询今天\ncurl -s \"https://timor.tech/api/holiday/info/$(date +%Y-%m-%d)\"\n\n# 查询指定日期\ncurl -s \"https://timor.tech/api/holiday/info/2026-02-28\"\n\n# 查询明天\ncurl -s \"https://timor.tech/api/holiday/info/$(date -d 'tomorrow' +%Y-%m-%d 2>/dev/null || date -v+1d +%Y-%m-%d)\"\n```\n\n### 查询指定年份的所有节假日\n\n```bash\n# 查询2026年所有节假日\ncurl -s \"https://timor.tech/api/holiday/year/2026/\"\n```\n\n### 批量查询多个日期\n\n```bash\n# 查询本周所有日期\for day in {0..6}; do\n  date_str=$(date -d \"$day days\" +%Y-%m-%d 2>/dev/null || date -v+${day}d +%Y-%m-%d)\n  curl -s \"https://timor.tech/api/holiday/info/$date_str\"\n  echo \"\"\ndone\n```\n\n## Response Format\n\n### 工作日/节假日信息\n\n```json\n{\n  \"code\": 0,\n  \"type\": {\n    \"type\": 0,      // 0: 工作日, 1: 周末, 2: 节日, 3: 调休\n    \"name\": \"工作日\",\n    \"week\": 6       // 星期几 (1-7)\n  },\n  \"holiday\": {\n    \"holiday\": false,     // 是否放假\n    \"name\": null,         // 节日名称\n    \"wage\": 1,            // 工资倍数 (1, 2, 3)\n    \"target\": null,       // 对应哪个节日\n    \"after\": false,       // 是否是节后补班\n    \"date\": \"2026-02-28\", // 日期\n    \"rest\": 1             // 休息天数\n  }\n}\n```\n\n### Type 类型说明\n\n| type | 含义 |\n|------|------|\n| 0 | 工作日 |\n| 1 | 周末 |\n| 2 | 节日 |\n| 3 | 调休 |\n\n### Holiday 类型说明\n\n| 场景 | holiday | after | 示例 |\n|------|---------|-------|------|\n| 正常工作日 | false | false | 周一到周五 |\n| 正常周末 | true | false | 周六、周日 |\n| 节假日 | true | false | 春节、国庆 |\n| 调休补班 | false | true | 春节后补班 |\n\n## Usage Examples\n\n### 判断明天是否需要上班\n\n```bash\nresponse=$(curl -s \"https://timor.tech/api/holiday/info/$(date -d 'tomorrow' +%Y-%m-%d)\")\nif echo \"$response\" | grep -q '\"holiday\":false'; then\n  echo \"明天是工作日，需要上班\"\nelse\n  echo \"明天放假，不用上班\"\nfi\n```\n\n### 获取下周所有工作日\n\n```bash\nfor day in {1..7}; do\n  date_str=$(date -d \"$day days\" +%Y-%m-%d)\n  response=$(curl -s \"https://timor.tech/api/holiday/info/$date_str\")\n  if echo \"$response\" | grep -q '\"holiday\":false'; then\n    echo \"$date_str: 工作日\"\n  fi\ndone\n```\n\n### 查询节假日名称\n\n```bash\ncurl -s \"https://timor.tech/api/holiday/info/2026-02-17\" | grep -o '\"name\":\"[^\"]*\"'\n```\n\n## PowerShell Usage (Windows)\n\n在 Windows PowerShell 中使用：\n\n```powershell\n# 查询今天\n$response = Invoke-RestMethod -Uri \"https://timor.tech/api/holiday/info/$(Get-Date -Format 'yyyy-MM-dd')\"\n$response.type.name\n$response.holiday.holiday\n\n# 查询明天\n$tomorrow = (Get-Date).AddDays(1).ToString(\"yyyy-MM-dd\")\n$response = Invoke-RestMethod -Uri \"https://timor.tech/api/holiday/info/$tomorrow\"\n$response\n```\n\n## Integration with OpenClaw\n\n在 Agent 中使用此 skill：\n\n1. 读取本 SKILL.md 了解 API 用法\n2. 使用 web_fetch 或 exec 调用 API\n3. 解析 JSON 响应\n4. 根据结果生成提醒或调整计划\n\n### Example Workflow\n\n```\n1. 获取明天的日期\n2. 调用 timor.tech API 查询\n3. 判断是否是工作日\n4. 如果是工作日 → 正常发送下班提醒\n5. 如果是假期 → 发送假期祝福，跳过下班提醒\n```\n\n## Notes\n\n- API 免费使用，无需注册\n- 数据每年由 timor.tech 维护更新\n- 节假日安排以国务院发布为准\n- 支持年份范围：当年及前后几年\n\n## Related\n\n- 农历查询：需配合其他农历 API\n- 国际节假日：使用 date.nager.at API","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":981,"installsAllTime":5,"installsCurrent":5,"stars":1,"versions":1},"createdAt":1772255674136,"updatedAt":1778491663809},"latestVersion":{"version":"1.0.0","createdAt":1772255674136,"changelog":"Chinese Calendar Skill v1.0.0\n\n- Initial release providing access to Chinese calendar information via the timor.tech API.\n- Supports checking if a date is a workday, holiday, or adjusted work/rest day.\n- Allows retrieval of annual holiday schedules and batch queries for multiple dates.\n- Includes code examples for Bash and PowerShell.\n- Data auto-updates yearly with official public holiday arrangements.\n- Designed for use in automation and reminders regarding workdays and holidays in China.","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"teweitao","userId":"s17am0ynpnjntg3ggyb49zjcj583h0x8","displayName":"TEweitao","image":"https://avatars.githubusercontent.com/u/133971480?v=4"},"moderation":null}