Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

阴历日期合理性检验 #5

Open
minchwu opened this issue Jan 10, 2019 · 4 comments
Open

阴历日期合理性检验 #5

minchwu opened this issue Jan 10, 2019 · 4 comments
Labels

Comments

@minchwu
Copy link

minchwu commented Jan 10, 2019

是否可以增加对阴历日期的合法性检验

比如,按阴历查询2018-12-31/32,查询结果依然存在而未报错

作者是否是按照计算参考某天的总天数,然后再计算日期的呀???

@minchwu minchwu closed this as completed Jan 10, 2019
@minchwu minchwu reopened this Jan 10, 2019
@yuangu yuangu added the 需求 label Feb 6, 2019
@yuangu
Copy link
Owner

yuangu commented Feb 22, 2019

已经增加,以异常的形式报出。
`import sxtwl
lunar = sxtwl.Lunar()

try:
lunar.getDayBySolar(2018, 13, 20)
except sxtwl.LunarException as e :
print(e.what())`

@xros
Copy link

xros commented Apr 5, 2019

pip python下载的模块没有更新。刚才看了下github上的最新代码 增加了上面的Exception https://github.com/yuangu/sxtwl_cpp/blob/master/python/sxtwl.py#L547
自己用swig编译测试了下日子和非法的月子。是可以跳出的。

except sxtwl.LunarException as e:
print(str(e))

不过好像没有年代范围呀。
例如

day0 = lunar.getDayBySolar(0,12,31)
day1 = lunar.getDayBySolar(1,12,31)
day_1 = lunar.getDayBySolar(-1,12,31)

正确的解应该是day0 和 day1 是同一年。只有公元1年。没有公元0年。公元1年可以理解为,BC1(-1年)

>>> day1.cur_mz
-161
>>> day0.cur_mz
-160

day1和day0应该是统一年的同一天。可是,到芒种节气的天数就差1天。是不是公元0年这块,有问题?

@yuangu
Copy link
Owner

yuangu commented Apr 5, 2019 via email

@yinzhewuming
Copy link

2019年4月5日~~开始改的呀~
现在还没改好!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants