# 节日纪念日

### 概述

此接口提供了一系列重要日期的倒计时以及自这些事件首次发生以来的年数。它支持跨域资源共享（CORS），允许任何域名上的应用请求数据。

### 接口详情

#### 请求URL

```
http://api.holytreasure.top/timeday.php
http://api.holytreasure.space/timeday.php
```

#### 请求方式

* GET

#### 返回格式

* Content-Type: `application/json; charset=utf-8`

目前支持的事件列表

* `new_year` (新年)
* `valentine` (情人节)
* `labour_day` (劳动节)
* `youth_day` (青年节)
* <mark style="color:red;">`founding_of_the_cpc`</mark> <mark style="color:red;"></mark><mark style="color:red;">(建党日)</mark>
* <mark style="color:red;">`victory_day`</mark> <mark style="color:red;"></mark><mark style="color:red;">(抗日战争胜利纪念日)</mark>
* <mark style="color:red;">`japanese_surrender`</mark> <mark style="color:red;"></mark><mark style="color:red;">(日本投降纪念日)</mark>
* <mark style="color:red;">`national_day`</mark> <mark style="color:red;"></mark><mark style="color:red;">(国庆节)</mark>
* `double_eleven` (双十一)
* <mark style="color:red;">`memorial_day`</mark> <mark style="color:red;"></mark><mark style="color:red;">(南京大屠杀公祭日)</mark>

特别注明：红色部分为支持获取周年，黑色部分仅支持计算日期

### 使用说明

示例代码：

```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>国庆节倒计时</title>
    <style>
        body { font-family: Arial, sans-serif; }
        .container { margin: 50px auto; width: 80%; text-align: center; }
    </style>
</head>
<body>
    <div class="container">
        <h1>国庆节倒计时</h1>
        <p id="countdown">正在加载...</p>
        <p id="anniversary">正在加载...</p>
    </div>

    <script>
        function fetchCountdown() {
            fetch('http://api.holytreasure.top/timeday.php')
                .then(response => response.json())
                .then(data => {
                    const nationalDayData = data.data.national_day;
                    document.getElementById('countdown').textContent = `距离国庆节还有 ${nationalDayData.days_until} 天`;
                    document.getElementById('anniversary').textContent = `今年是建国 ${nationalDayData.years_since} 周年`;
                })
                .catch(error => {
                    console.error('Error fetching countdown:', error);
                    document.getElementById('countdown').textContent = '获取倒计时失败';
                    document.getElementById('anniversary').textContent = '获取周年数失败';
                });
        }

        // 在页面加载完成后立即获取数据
        window.addEventListener('load', fetchCountdown);
    </script>
</body>
</html>
```

### 更新日志：

2024.09.09-发布初代版本


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.holytreasure.space/kai-fang-jie-kou-api/jie-ri-ji-nian-ri.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
