Browse Source

update readme

yaavi 1 year ago
parent
commit
e7de0ede4f
5 changed files with 51 additions and 11 deletions
  1. 4 0
      CHANGELOG.md
  2. 20 3
      README.en.md
  3. 20 3
      README.md
  4. 2 2
      package-lock.json
  5. 5 3
      package.json

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 # CHANGELOG
 
+## [1.3.0](https://github.com/vsme/chinese-days) (2024-06-15)
+
+- 支持 `ics` 文件订阅节假日,可供 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端订阅
+
 ## [1.2.4](https://github.com/vsme/chinese-days) (2024-06-03)
 
 - 兼容 Safari 日期格式

+ 20 - 3
README.en.md

@@ -6,19 +6,27 @@
 
 > Translated by ChatGPT-4, PRs are welcome.
 
-This project provides a set of functions for querying Chinese holidays, adjustment days, workdays, the 24 solar terms, and conversions between the lunar and solar calendars. Chinese holidays will be updated according to the releases from the State Council.
+This project provides a series of functions for querying Chinese holidays, adjusted working days, working days, 24 solar terms, and converting between lunar and solar calendars. Additionally, it supports ics file subscription for holidays, which can be subscribed to by Google Calendar, Apple Calendar, Microsoft Outlook, and other clients. The holiday information will be updated according to the announcements from the State Council.
 
 + **Holidays**: Supports the years 2004 to 2024, including the extended Spring Festival of 2020.
 + **24 Solar Terms**: Supports the years 1900 to 2100.
 + **Lunar Days**: Supports the years 1900 to 2100.
 
+## Subscribe to Calendar
+
+The subscribed calendar includes holidays and adjusted working days for the past three years (2022-2024).
+
+Subscription URL: [https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics](https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics)
+
 ## For non-JS projects, you can use the JSON file
 
 A `JSON` file of Chinese holidays is provided and can be directly referenced through this link: [chinese-days.json](https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json).
 
 ## Quick Start
 
-Recommended approach: Direct browser import for more timely updates
+### Recommended approach
+
+Direct browser import for more timely updates
 
 ```html
 <script src="https://cdn.jsdelivr.net/npm/chinese-days/dist/index.min.js"></script>
@@ -29,7 +37,16 @@ Recommended approach: Direct browser import for more timely updates
 </script>
 ```
 
-Installation:
+OR
+
+```html
+<script type="module">
+  import chineseDays from 'https://cdn.jsdelivr.net/npm/chinese-days/dist/index.es.js'
+  chineseDays.isHoliday('2024-01-01');
+</script>
+```
+
+### Installation:
 
 ```sh
 npm i chinese-days

+ 20 - 3
README.md

@@ -4,19 +4,27 @@
 [![GitHub License](https://img.shields.io/github/license/vsme/chinese-days)](https://github.com/vsme/chinese-days/blob/main/LICENSE)
 [![README](https://img.shields.io/badge/README-English-brightgreen.svg)](https://github.com/vsme/chinese-days/blob/main/README.en.md)
 
-本项目提供了一系列用于查询中国节假日、调休日、工作日、24节气、以及农历阳历互转的函数,中国节假日会跟随国务院发布进行更新。
+本项目提供了一系列用于查询中国节假日、调休日、工作日、24节气、以及农历阳历互转的函数,此外还支持 `ics` 文件订阅节假日,可供 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端订阅,节假日信息会跟随国务院发布进行更新。
 
 + **节假日**:支持 2004年 至 2024年,包括 2020年 的春节延长
 + **24节气**:支持 1900年 至 2100年。
 + **农历日**:支持 1900年 至 2100年。
 
+## 日历订阅
+
+在 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端中,可以设置订阅地址:[https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics](https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics) 来获取日历订阅。
+
+订阅的日历包含近三年(2022-2024年)的节假日和调休日。
+
 ## 非 `JS` 语言
 
 提供了中国节假日的 `JSON` 文件,通过链接 [chinese-days.json](https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json) 可以直接引用。
 
 ## 快速开始
 
-推荐方式:直接浏览器引入,更新较为及时
+### 推荐方式
+
+直接浏览器引入,更新较为及时
 
 ```html
 <script src="https://cdn.jsdelivr.net/npm/chinese-days/dist/index.min.js"></script>
@@ -27,7 +35,16 @@
 </script>
 ```
 
-其他方式安装
+或者
+
+```html
+<script type="module">
+  import chineseDays from 'https://cdn.jsdelivr.net/npm/chinese-days/dist/index.es.js'
+  chineseDays.isHoliday('2024-01-01');
+</script>
+```
+
+### 其他方式安装
 
 ```sh
 npm i chinese-days

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "chinese-days",
-  "version": "1.2.4",
+  "version": "1.3.0",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "chinese-days",
-      "version": "1.2.4",
+      "version": "1.3.0",
       "license": "MIT",
       "devDependencies": {
         "@types/jest": "^29.5.12",

+ 5 - 3
package.json

@@ -1,7 +1,7 @@
 {
   "name": "chinese-days",
-  "version": "1.2.4",
-  "description": "中国节假日、调休日、工作日、24节气查询,农历阳历互转,支持 TS、CommonJS、UMD 模块化使用。",
+  "version": "1.3.0",
+  "description": "中国节假日、调休日、工作日、24节气查询,农历阳历互转,支持 TS、CommonJS、UMD 模块化使用,提供 ics 日历格式,可供 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端订阅。",
   "main": "dist/index.min.js",
   "module": "dist/index.es.js",
   "types": "dist/index.d.ts",
@@ -32,7 +32,9 @@
     "24节气",
     "农历",
     "阴历",
-    "阳历"
+    "阳历",
+    "日历",
+    "订阅"
   ],
   "author": "Yaavi",
   "license": "MIT",