var Calendar = function (t) { this.divId = t.RenderID ? t.RenderID : '[data-render="calendar"]', this.DaysOfWeek = t.DaysOfWeek ? t.DaysOfWeek : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], this.Months = t.Months ? t.Months : ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]; var e = new Date; this.CurrentMonth = e.getMonth(), this.CurrentYear = e.getFullYear(); var r = t.Format; this.f = "string" == typeof r ? r.charAt(0).toUpperCase() : "M" }; Calendar.prototype.nextMonth = function () { 11 == this.CurrentMonth ? (this.CurrentMonth = 0, this.CurrentYear = this.CurrentYear + 1) : this.CurrentMonth = this.CurrentMonth + 1, this.divId = '[data-active="false"] .render', this.showCurrent() }, Calendar.prototype.prevMonth = function () { 0 == this.CurrentMonth ? (this.CurrentMonth = 11, this.CurrentYear = this.CurrentYear - 1) : this.CurrentMonth = this.CurrentMonth - 1, this.divId = '[data-active="false"] .render', this.showCurrent() }, Calendar.prototype.previousYear = function () { this.CurrentYear = this.CurrentYear - 1, this.showCurrent() }, Calendar.prototype.nextYear = function () { this.CurrentYear = this.CurrentYear + 1, this.showCurrent() }, Calendar.prototype.showCurrent = function () { this.Calendar(this.CurrentYear, this.CurrentMonth) }, Calendar.prototype.checkActive = function () { 1 == document.querySelector(".months").getAttribute("class").includes("active") ? document.querySelector(".months").setAttribute("class", "months") : document.querySelector(".months").setAttribute("class", "months active"), "true" == document.querySelector(".month-a").getAttribute("data-active") ? (document.querySelector(".month-a").setAttribute("data-active", !1), document.querySelector(".month-b").setAttribute("data-active", !0)) : (document.querySelector(".month-a").setAttribute("data-active", !0), document.querySelector(".month-b").setAttribute("data-active", !1)), setTimeout(function () { document.querySelector(".calendar .header").setAttribute("class", "header active") }, 200), document.querySelector("body").setAttribute("data-theme", this.Months[document.querySelector('[data-active="true"] .render').getAttribute("data-month")].toLowerCase()) }, Calendar.prototype.Calendar = function (t, e) { "number" == typeof t && (this.CurrentYear = t), "number" == typeof t && (this.CurrentMonth = e); var r = (new Date).getDay(), n = (new Date).getMonth(), a = (new Date).getFullYear(), o = new Date(t, e, 1).getDay(), i = new Date(t, e + 1, 0).getDate(), u = 0 == e ? new Date(t - 1, 11, 0).getDate() : new Date(t, e, 0).getDate(), s = "" + t + "年 " + this.Months[e] + "", d = '