Repository: kinegratii/borax

Issue:
农历:LunarDate.cn_day_calendar 计算错误%F 描述符缺少“月”后缀
## 问题类型

- [X] BUG
- [ ] 新功能
- [ ] 功能优化

## 问题

LunarDate.cn_day_calendar 计算错误，同时 '%F' 描述符计算错误。


## 代码

```python
from borax.calendars import LunarDate, LCalendars
print([LunarDate(year=2017, month=month, day=1, leap=leap).cn_day_calendar for month, days, leap in LCalendars.iter_year_month(2017)])
```

结果为

```
['正', '二', '三', '四', '五', '六', '六', '七', '八', '九', '十', '冬', '腊']
```

正确结果为

```

```
['正月', '二月', '三月', '四月', '五月', '六月', '闰六', '七月', '八月', '九月', '十月', '冬月', '腊月']
```
```


Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=h1) Report
> Merging [#21](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=desc) (f92cf44) into [develop](https://codecov.io/gh/kinegratii/borax/commit/f9e51116e04eb9539e54e0db1e321b6e40200903?el=desc) (f9e5111) will **increase** coverage by `0.19%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/kinegratii/borax/pull/21/graphs/tree.svg?width=650&height=150&src=pr&token=322BKY7581)](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##           develop      #21      +/-   ##
===========================================
+ Coverage    86.34%   86.54%   +0.19%     
===========================================
  Files           29       29              
  Lines         1641     1643       +2     
===========================================
+ Hits          1417     1422       +5     
+ Misses         224      221       -3     
```


| [Impacted Files](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [borax/calendars/lunardate.py](https://codecov.io/gh/kinegratii/borax/pull/21/diff?src=pr&el=tree#diff-Ym9yYXgvY2FsZW5kYXJzL2x1bmFyZGF0ZS5weQ==) | `95.75% <100.00%> (+0.77%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=footer). Last update [f9e5111...f92cf44](https://codecov.io/gh/kinegratii/borax/pull/21?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/borax/calendars/lunardate.py b/borax/calendars/lunardate.py
index 1ff9b59..b7adda7 100644
--- a/borax/calendars/lunardate.py
+++ b/borax/calendars/lunardate.py
@@ -456,7 +456,10 @@ class LunarDate(EncoderMixin):
     @property
     def cn_day_calendar(self) -> str:
         if self.day == 1:
-            return self.cn_month
+            if self.leap:
+                return '闰{}'.format(self.cn_month)
+            else:
+                return '{}月'.format(self.cn_month)
         else:
             return self.cn_day
 


Test patch:
diff --git a/tests/test_lunardate.py b/tests/test_lunardate.py
index 3d1d7a1..86417c7 100644
--- a/tests/test_lunardate.py
+++ b/tests/test_lunardate.py
@@ -127,6 +127,7 @@ class FormatterTestCase(unittest.TestCase):
         ld2 = LunarDate(2018, 11, 23)
         self.assertEqual('二〇一八/冬/廿三', ld2.strftime('%Y/%M/%D'))
         self.assertEqual('二〇一八/十一/廿三', ld2.strftime('%Y/%N/%D'))
+        self.assertEqual('廿三', ld2.strftime('%F'))
 
         ld3 = LunarDate(2017, 6, 3, 1)
         self.assertEqual('61', ld3.strftime('%m%l'))
@@ -143,6 +144,12 @@ class FormatterTestCase(unittest.TestCase):
         ld = LunarDate(2020, 3, 23)
         self.assertEqual('tem:-', ld.strftime('tem:%t'))
 
+    def test_cn_calendar_day(self):
+        ld = LunarDate(2017, 6, 1, 1)
+        self.assertEqual('闰六', ld.strftime('%F'))
+        ld1 = LunarDate(2017, 11, 1, 0)
+        self.assertEqual('冬月', ld1.strftime('%F'))
+
 
 class LCalendarTestCase(unittest.TestCase):
     def test_ndays(self):