Skip to content

日历,农历公历转换,并年月日分别选择JS

Notifications You must be signed in to change notification settings

chenfahui/calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

calendar

日历,可选农历或公历,并年月日分别选择JS

公历转农历:

 calendar.solar2lunarFormat({
   solarYear:solarYear,//公历年
   solarMonth:solarMonth,//公历月
   solarDay:solarDay//公历天
 });

农历转公历:

 calendar.lunar2solarFormat({
   lunarYear:lunarYear,//农历年
   lunarMonth:lunarMonth,//农历月
   lunarDay:lunarDay//农历天
 });

获取年数据:

 calendar.listYear({
     isLunar:isLunar,//是否农历
     nowYear:nowYear//当前年份
 });

根据年,获取月数据:

 calendar.listMonth({
     isLunar:isLunar,//是否农历
     year:year, //选中年份
     nowYear:nowYear,//当前年份
     nowMonth:nowMonth,//当前月份
 });

根据年月,获取天数据:

 calendar.listDay({
     isLunar:isLunar,//是否农历
     year:year, //选中年份
     month:month,//选中月份
     nowYear:nowYear,//当前年份
     nowMonth:nowMonth,//当前月份
     nowDay:nowDay//当前天
 });

根据农历数值,换算成汉字:

 calendar.toChinaFormat({
   lunarYear:lunarYear,//农历年
   lunarMonth:lunarMonth,//农历月
   lunarDay:lunarDay//农历天
 });

About

日历,农历公历转换,并年月日分别选择JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published