waterbeside / lunisolar

Typescript农历库,支持阴历公历互转,支持各类黄历数据查询,如八字四柱、阴历、神煞宜忌、建除十二神、胎神占方、吉神方位、五行纳音等。支持自定义插件。
https://lunisolar.js.org
GNU General Public License v3.0
208 stars 21 forks source link

阳历换年后-农历换年前 23:00-24:00 换日错误 #35

Open TianYi0217 opened 1 week ago

TianYi0217 commented 1 week ago

import lunisolar from 'lunisolar'; 输入:

    const time011022 = lunisolar('2024/01/10 22:00:00')
    const time011023 = lunisolar('2024/01/10 23:00:00')
    const time011024 = lunisolar('2024/01/10 24:00:00')
    console.log(`2024/01/10 22:00:00 = ${time011022}`);
    console.log(`2024/01/10 23:00:00 = ${time011023}`);
    console.log(`2024/01/10 24:00:00 = ${time011024}`);
    const time020922 = lunisolar('2024/02/09 22:00:00')
    const time020923 = lunisolar('2024/02/09 23:00:00')
    const time020924 = lunisolar('2024/02/09 24:00:00')
    console.log(`2024/02/09 22:00:00 = ${time020922}`);
    console.log(`2024/02/09 23:00:00 = ${time020923}`);
    console.log(`2024/02/09 24:00:00 = ${time020924}`);

终端输出:

2024/01/10 22:00:00 = Wed, 10 Jan 2024 14:00:00 GMT (二〇二三年十一月廿九亥時) utcOffset: 480

2024/01/10 23:00:00 = Wed, 10 Jan 2024 15:00:00 GMT (二〇二三年十一月廿九子時) utcOffset: 480

2024/01/10 24:00:00 = Wed, 10 Jan 2024 16:00:00 GMT (二〇二三年十二月初一子時) utcOffset: 480

2024/02/09 22:00:00 = Fri, 09 Feb 2024 14:00:00 GMT (二〇二三年十二月三十亥時) utcOffset: 480

2024/02/09 23:00:00 = Fri, 09 Feb 2024 15:00:00 GMT (二〇二四年正月初一子時) utcOffset: 480

2024/02/09 24:00:00 = Fri, 09 Feb 2024 16:00:00 GMT (二〇二四年正月初一子時) utcOffset: 480

此处的日期2024/01/10 23:00:00应为十二月初一子時


diffDate1902to2098.json

经过遍历, 查询到不同的时间存在了附件中. 推测是 阳历换年后-农历换年前 这段时间的问题.

waterbeside commented 1 day ago

十分感谢反馈,已经修复并更新版本到v2.5.1。 谢谢。