diff --git a/borax/__init__.py b/borax/__init__.py index c3df011..86ad3c7 100644 --- a/borax/__init__.py +++ b/borax/__init__.py @@ -1,2 +1,2 @@ -__version__ = '4.1.0' +__version__ = '4.1.1' __author__ = 'kinegratii' diff --git a/docs/changelog.md b/docs/changelog.md index 1be80c8..d6331ae 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,6 @@ # 更新日志 -## v4.1.1 +## v4.1.1 (20240630) - 新增创建农历年或农历月最后一天的方法 `LunarDate.last_day` - `SolarFestival` 和`LunarFestival` 初始化函数 `freq` 参数支持字符串设置( [ #56](https://github.com/kinegratii/borax/issues/56) ) diff --git a/docs/guides/lunardate.md b/docs/guides/lunardate.md index baea60f..0d52024 100644 --- a/docs/guides/lunardate.md +++ b/docs/guides/lunardate.md @@ -103,6 +103,19 @@ LunarDate(2018, 6, 29, 0) LunarDate(2018, 7, 2, 0) ``` +获取农历年或农历月的最后一天。(v4.1.1新增。) + +```bash +>>>LunarDate.last_day(2023) +LunarDate(2023, 12, 30) +>>>LunarDate.last_day(2023, 2) +LunarDate(2023, 2, 30) +>>>LunarDate.last_day(2023, 2, 1) +LunarDate(2023, 2, 29, 1) +``` + + + `lunardate` 模块可用的日期上下限 ```shell diff --git a/docs/images/app_festival_creator.png b/docs/images/app_festival_creator.png index 03f7be7..ef4792b 100644 Binary files a/docs/images/app_festival_creator.png and b/docs/images/app_festival_creator.png differ diff --git a/tests/test_lunardate.py b/tests/test_lunardate.py index 6005949..3c453fb 100644 --- a/tests/test_lunardate.py +++ b/tests/test_lunardate.py @@ -37,8 +37,6 @@ def test_create_specific_dates(self): self.assertEqual(5, LCalendars.delta(today.after(5), today)) self.assertEqual(-5, LCalendars.delta(today.before(5), today)) - self.assertEqual(LunarDate(2023, 12, 30), LunarDate.last_day_of_year(2023)) - def test_last_day(self): self.assertEqual(LunarDate(2023, 12, 30), LunarDate.last_day(2023)) self.assertEqual(LunarDate(2023, 1, 29), LunarDate.last_day(2023, 1))