lunar
lunar copied to clipboard
农历与公历相互转换的模块,支持农历之间的加减运算,并提供生肖、干支等,支持1900-2100年。
看了下原码,这个也太硬编码了,太容易错,且对于不在范围内的日期不能用。
https://github.com/wvv8oo/lunar/blob/5dfe9f1306253548622cd040234a17eb3cc2c05e/lib/chinese-lunar.js#L627 感觉像是这行代码是优先考虑了AMD模式,但是在小程序的框架中的define函数和AMD中define函数不一样,所以会导致里面的回调不执行,也就引入不了。我提了个PR增加了更严格的AMD模式检查,规避了这种情况。
link: issue; #13
你好,经过对比发现2070年以后的农历MAPPING信息不准确,建议检查。
如题,不知道作者还管不管这个项目了
https://github.com/wvv8oo/lunar/blob/34940a8a0c3db14d35e973ab53b9d86a89542fce/lib/chinese-lunar.js#L540 https://github.com/wvv8oo/lunar/blob/34940a8a0c3db14d35e973ab53b9d86a89542fce/lib/chinese-lunar.js#L244 https://github.com/wvv8oo/lunar/blob/34940a8a0c3db14d35e973ab53b9d86a89542fce/lib/chinese-lunar.js#L248 例子: ```javascript var a = new Date(2017, 7, 22) // 农历七月初一 var b = new Date('2017-9-1 16:20:20') // 农历七月十一 var c = new Date('2017-9-1') var span1 =...