Skip to content

Commit

Permalink
v1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vsme committed May 30, 2024
1 parent 397f474 commit e6d0955
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## [1.2.3](https://github.com/vsme/chinese-days) (2024-05-30)

- 不在节假日范围内的日期不再抛出异常

## [1.2.2](https://github.com/vsme/chinese-days) (2024-05-29)

- 增加 `getSolarTermsInRange` 获取日期范围内节气
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chinese-days",
"version": "1.2.2",
"version": "1.2.3",
"description": "中国节假日、调休日、工作日、24节气查询,农历阳历互转,支持 TS、CommonJS、UMD 模块化使用。",
"main": "dist/index.min.js",
"module": "dist/index.es.js",
Expand Down
6 changes: 0 additions & 6 deletions src/holidays/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ const _validateDate = (...dates: ConfigType[]): Dayjs | Dayjs[] => {
if (!date.isValid()) {
throw new Error(`unsupported type ${typeof date}, expected type is Date or Dayjs`);
}
const allHolidays = Object.keys(holidays).sort()
const minYear = dayjs(allHolidays[0]).year();
const maxYear = dayjs(allHolidays.slice(-1)[0]).year();
if (!(minYear <= date.year() && date.year() <= maxYear)) {
throw new Error(`no available data for year ${date.year()}, only year between [${minYear}, ${maxYear}] supported`);
}
return date;
}

Expand Down

0 comments on commit e6d0955

Please sign in to comment.