上代码:
//上下月文字替换显示//记得把departure-schedule-content替换成你们自己的 function prevNextMonth(){ var MonthStr=$(".departure-schedule-content .fc-header .fc-header-center .fc-header-title h2").text(); var Year=MonthStr.substring(0,MonthStr.indexOf("年"))-1; var Month=MonthStr.substring(MonthStr.indexOf("年")+1,MonthStr.indexOf("月"))-1; var monthPrev = new Date(Year,Month - 1, 1).getMonth()+1; var monthNext = new Date(Year,Month + 1, 1).getMonth()+1; var $buttonPrev=$(".departure-schedule-content .fc-header .fc-button-prev"); var $buttonNext=$(".departure-schedule-content .fc-header .fc-button-next"); $buttonPrev.empty().append("<"+""+monthPrev+"月"); $buttonNext.empty().append(""+monthNext+"月"+">"); }