6tail / lunar-go

日历、公历(阳历)、农历(阴历、老黄历)、道历、佛历,支持节假日、星座、儒略日、干支、生肖、节气、节日、彭祖百忌、每日宜忌、吉神宜趋凶煞宜忌、吉神(喜神/福神/财神/阳贵神/阴贵神)方位、胎神方位、冲煞、纳音、星宿、八字、五行、十神、建除十二值星、青龙名堂等十二神、黄道黑道日及吉凶等。lunar is a calendar library for Solar and Chinese Lunar.
https://6tail.cn/calendar/api.html
MIT License
229 stars 61 forks source link

[BUG] HolidayUtil获取2022春节假期错误 #7

Closed yrzs closed 1 year ago

yrzs commented 1 year ago
h := HolidayUtil.GetHolidays("2022-01")
    for i := h.Front(); i != nil; i = i.Next() {
        value := i.Value.(*calendar.Holiday)
        fmt.Println(value.GetDay(), value.GetName())
    }
output:
  2022-01-01 元旦节
  2022-01-02 元旦节
  2022-01-03 元旦节
  2022-01-29 春节
  2022-01-30 春节
  2022-01-31 春节

实际上 2022-01-29 2022-01-30 并不是春节假期

6tail commented 1 year ago

请仔细阅读文档,那两天是春节调休,周末上班。

yrzs commented 1 year ago

ok,原来调休也在假期方法里