Skip to content

Commit

Permalink
Merge pull request #156 from wangxinleo/feature/develop
Browse files Browse the repository at this point in the history
closed #152
  • Loading branch information
wangxinleo authored Sep 13, 2022
2 parents f531064 + 406e508 commit daa44a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ wechat-public-account-push

**如果这个项目很有意思,帮忙右上角点个 star✨ 支持我们 ❤❤**

**如果有任何需要帮助可以联系wangxin.leo@outlook.com ❤❤**

[>>> 点这里获取更新公告✨](https://github.com/wangxinleo/wechat-public-account-push/discussions/categories/announcements)

详细功能如下:
Expand Down Expand Up @@ -698,7 +700,7 @@ on:

时区查询: [https://www.zeitverschiebung.net/cn/all-time-zones.html](https://www.zeitverschiebung.net/cn/all-time-zones.html)

## 11. 叨叨两句
<!-- ## 11. 叨叨两句
**这个仓库只能算是重复实现一下别人的想法, 主要是了解到了这个想法却一直找不到原作者的源码很是苦恼, 结果还遇到了要求加关注的情况**
Expand All @@ -708,4 +710,4 @@ on:
![图片无法查看请移步顶部访问 国内备用仓库地址](img/dis.png)
![图片无法查看请移步顶部访问 国内备用仓库地址](img/dis-2.png)
![图片无法查看请移步顶部访问 国内备用仓库地址](img/dis-2.png) -->
9 changes: 7 additions & 2 deletions src/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ export const getBirthdayMessage = (festivals) => {
type = type.replace(/^\*/, '')
const [month, day] = date.split('-').map(Number)
// 获取今年的生日信息
const lunarInThisYear = Lunar.fromYmd((new Date).getFullYear(), month, day)
const solarInThisYear = lunarInThisYear.getSolar()
const thisYear = (new Date).getFullYear()
let lunarInThisYear = Lunar.fromYmd(thisYear, month, day)
let solarInThisYear = lunarInThisYear.getSolar()
if (solarInThisYear.getYear() > thisYear) {
lunarInThisYear = Lunar.fromYmd(thisYear - 1, month, day)
solarInThisYear = lunarInThisYear.getSolar()
}
const lunar = Lunar.fromYmd(Number(year), month, day)
const solar = lunar.getSolar()
return {
Expand Down

0 comments on commit daa44a8

Please sign in to comment.