Browse Source

rename: chinese-days

Yaavi 1 year ago
parent
commit
f5887b20d0
5 changed files with 34 additions and 26 deletions
  1. 15 11
      README.en.md
  2. 13 9
      README.md
  3. 2 2
      package-lock.json
  4. 3 3
      package.json
  5. 1 1
      vite.config.ts

+ 15 - 11
README.en.md

@@ -1,8 +1,8 @@
-# China Days
+# Chinese Days
 
 
-![NPM Version](https://img.shields.io/npm/v/china-days)
-![GitHub License](https://img.shields.io/github/license/vsme/china-days)
-[![README](https://img.shields.io/badge/README-中文-brightgreen.svg)](https://github.com/vsme/china-days/blob/main/README.md)
+![NPM Version](https://img.shields.io/npm/v/chinese-days)
+![GitHub License](https://img.shields.io/github/license/vsme/chinese-days)
+[![README](https://img.shields.io/badge/README-中文-brightgreen.svg)](https://github.com/vsme/chinese-days/blob/main/README.md)
 
 
 > Translated by ChatGPT-4, PRs are welcome.
 > Translated by ChatGPT-4, PRs are welcome.
 
 
@@ -17,26 +17,30 @@ Description:
 Include directly in your browser:
 Include directly in your browser:
 
 
 ```html
 ```html
-<script src="https://cdn.jsdelivr.net/npm/china-days/dist/index.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/chinese-days/dist/index.min.js"></script>
+<script>
+  const { isHoliday } = chineseDays
+  console.log(isHoliday('2024-01-01'))
+</script>
 ```
 ```
 
 
 Installation:
 Installation:
 
 
 ```sh
 ```sh
-npm i china-days
+npm i chinese-days
 ```
 ```
 
 
 Using ESM import:
 Using ESM import:
 
 
 ```ts
 ```ts
-import chinaDays from 'china-days'
-console.log(chinaDays)
+import chineseDays from 'chinese-days'
+console.log(chineseDays)
 ```
 ```
 
 
 Using in Node.js:
 Using in Node.js:
 
 
 ```js
 ```js
-const { isWorkday, isHoliday } = require('china-days');
+const { isWorkday, isHoliday } = require('chinese-days');
 console.log(isWorkday('2020-01-01'));
 console.log(isWorkday('2020-01-01'));
 console.log(isHoliday('2020-01-01'));
 console.log(isHoliday('2020-01-01'));
 ```
 ```
@@ -57,7 +61,7 @@ console.log(isHoliday('2023-01-01')); // true
 
 
 ### `isInLieu` Check if a date is an in lieu day
 ### `isInLieu` Check if a date is an in lieu day
 
 
-In China's holiday arrangement, an in lieu day is a workday or a rest day adjusted for consecutive holidays or make-up workdays. For example, if a public holiday is connected to a weekend, a weekend day might be adjusted to a workday, or a workday might be adjusted to a rest day for a longer consecutive holiday.
+On a Chinese holiday arrangement, an in lieu day is a workday or a rest day adjusted for consecutive holidays or make-up workdays. For example, if a public holiday is connected to a weekend, a weekend day might be adjusted to a workday, or a workday might be adjusted to a rest day for a longer consecutive holiday.
 
 
 ```js
 ```js
 // Check if 2024-05-02 is an in lieu day. Returns `true` if it is.
 // Check if 2024-05-02 is an in lieu day. Returns `true` if it is.
@@ -155,7 +159,7 @@ console.log(secondNextWorkday);
 ### Get dates of the 24 solar terms
 ### Get dates of the 24 solar terms
 
 
 ```js
 ```js
-import { getSolarTerms } from "china-days";
+import { getSolarTerms } from "chinese-days";
 
 
 /** Get an array of solar term dates within a range */
 /** Get an array of solar term dates within a range */
 const solarTerms = getSolarTerms("2024-05-01", "2024-05-20");
 const solarTerms = getSolarTerms("2024-05-01", "2024-05-20");

+ 13 - 9
README.md

@@ -1,8 +1,8 @@
 # 中国节假日
 # 中国节假日
 
 
-![NPM Version](https://img.shields.io/npm/v/china-days)
-![GitHub License](https://img.shields.io/github/license/vsme/china-days)
-[![README](https://img.shields.io/badge/README-English-brightgreen.svg)](https://github.com/vsme/china-days/blob/main/README.en.md)
+![NPM Version](https://img.shields.io/npm/v/chinese-days)
+![GitHub License](https://img.shields.io/github/license/vsme/chinese-days)
+[![README](https://img.shields.io/badge/README-English-brightgreen.svg)](https://github.com/vsme/chinese-days/blob/main/README.en.md)
 
 
 本项目提供了一系列用于管理和查询中国节假日、调休日、工作日及二十四节气的函数。通过使用这些函数,用户可以方便地检查指定日期的状态,获取日期范围内的节假日或工作日,并查找特定的工作日。此外,项目还支持查询二十四节气的日期,帮助用户了解中国传统节气的时间安排。
 本项目提供了一系列用于管理和查询中国节假日、调休日、工作日及二十四节气的函数。通过使用这些函数,用户可以方便地检查指定日期的状态,获取日期范围内的节假日或工作日,并查找特定的工作日。此外,项目还支持查询二十四节气的日期,帮助用户了解中国传统节气的时间安排。
 
 
@@ -15,26 +15,30 @@
 直接浏览器引入
 直接浏览器引入
 
 
 ```html
 ```html
-<script src="https://cdn.jsdelivr.net/npm/china-days/dist/index.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/chinese-days/dist/index.min.js"></script>
+<script>
+  const { isHoliday } = chineseDays
+  console.log(isHoliday('2024-01-01'))
+</script>
 ```
 ```
 
 
 安装
 安装
 
 
 ```sh
 ```sh
-npm i china-days
+npm i chinese-days
 ```
 ```
 
 
 使用 ESM 导入
 使用 ESM 导入
 
 
 ```ts
 ```ts
-import chinaDays from 'china-days'
-console.log(chinaDays)
+import chineseDays from 'chinese-days'
+console.log(chineseDays)
 ```
 ```
 
 
 在 Node 中使用
 在 Node 中使用
 
 
 ```js
 ```js
-const { isWorkday, isHoliday } = require('china-days');
+const { isWorkday, isHoliday } = require('chinese-days');
 console.log(isWorkday('2020-01-01'));
 console.log(isWorkday('2020-01-01'));
 console.log(isHoliday('2020-01-01'));
 console.log(isHoliday('2020-01-01'));
 ```
 ```
@@ -155,7 +159,7 @@ console.log(secondNextWorkday);
 ### 获取 24 节气的日期
 ### 获取 24 节气的日期
 
 
 ```js
 ```js
-import { getSolarTerms } from "china-days";
+import { getSolarTerms } from "chinese-days";
 
 
 /** 获取范围内 节气日期数组 */
 /** 获取范围内 节气日期数组 */
 const solarTerms = getSolarTerms("2024-05-01", "2024-05-20");
 const solarTerms = getSolarTerms("2024-05-01", "2024-05-20");

+ 2 - 2
package-lock.json

@@ -1,11 +1,11 @@
 {
 {
-  "name": "china-days",
+  "name": "chinese-days",
   "version": "0.2.0",
   "version": "0.2.0",
   "lockfileVersion": 3,
   "lockfileVersion": 3,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
-      "name": "china-days",
+      "name": "chinese-days",
       "version": "0.2.0",
       "version": "0.2.0",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {

+ 3 - 3
package.json

@@ -1,5 +1,5 @@
 {
 {
-  "name": "china-days",
+  "name": "chinese-days",
   "version": "0.2.0",
   "version": "0.2.0",
   "description": "中国节假日、调休日、工作日、24节气查询,农历阳历互转,支持 TS、CommonJS、UMD 模块化使用。",
   "description": "中国节假日、调休日、工作日、24节气查询,农历阳历互转,支持 TS、CommonJS、UMD 模块化使用。",
   "main": "dist/index.min.js",
   "main": "dist/index.min.js",
@@ -8,7 +8,7 @@
   "type": "commonjs",
   "type": "commonjs",
   "repository": {
   "repository": {
     "type": "git",
     "type": "git",
-    "url": "https://github.com/vsme/china-days"
+    "url": "https://github.com/vsme/chinese-days"
   },
   },
   "files": [
   "files": [
     "dist/*",
     "dist/*",
@@ -37,7 +37,7 @@
   "author": "Yaavi",
   "author": "Yaavi",
   "license": "MIT",
   "license": "MIT",
   "bugs": {
   "bugs": {
-    "url": "https://github.com/vsme/china-days/issues"
+    "url": "https://github.com/vsme/chinese-days/issues"
   },
   },
   "dependencies": {
   "dependencies": {
     "dayjs": "^1.11.11"
     "dayjs": "^1.11.11"

+ 1 - 1
vite.config.ts

@@ -8,7 +8,7 @@ export default defineConfig(() => ({
     sourcemap: false,
     sourcemap: false,
     lib: {
     lib: {
       entry: "./src/index.ts",
       entry: "./src/index.ts",
-      name: "chinaDays",
+      name: "ChineseDays",
       formats: ["umd", "es"],
       formats: ["umd", "es"],
       fileName: (format) => format == 'umd' ? 'index.min.js' : `index.${format}.js`,
       fileName: (format) => format == 'umd' ? 'index.min.js' : `index.${format}.js`,
     },
     },