1.下载依赖
npm install chinese-lunar-calendar
2.引入依赖
import { getLunar } from 'chinese-lunar-calendar';
3.使用
const lunarDate =getLunar(2024, 8, 1)
console.log(lunarDate)
4.打印结果
{
"lunarMonth": 6,
"lunarDate": 27,
"isLeap": false,
"solarTerm": null,
"lunarYear": "甲辰年",
"zodiac": "龙",
"dateStr": "六月廿七"
}