|
@@ -55,6 +55,7 @@ Calendar.prototype = {
|
|
|
"0100": "除夕"
|
|
|
},
|
|
|
newDate: new Date(),
|
|
|
+ currentDate:'',
|
|
|
width: null,
|
|
|
shwoLunar: false,
|
|
|
showModeBtn: true,
|
|
@@ -91,6 +92,9 @@ Calendar.prototype = {
|
|
|
$(".dropdown-month").removeClass("open");
|
|
|
$(".dropdown-year").removeClass("open");
|
|
|
|
|
|
+ $('.calendar-table td').removeClass("calendar-today");
|
|
|
+ $(e.currentTarget).addClass("calendar-today")
|
|
|
+
|
|
|
var cellDate = $(this).attr("title");
|
|
|
var DataArry=[];
|
|
|
var viewData = me.viewData;
|
|
@@ -99,6 +103,11 @@ Calendar.prototype = {
|
|
|
var datajson=viewData[month];
|
|
|
var date = parseInt(cellDate.split("年")[1].split("月")[1].split("日")[0]);
|
|
|
|
|
|
+ opts.currentDate = {
|
|
|
+ year:year,
|
|
|
+ month:month+1
|
|
|
+ }
|
|
|
+
|
|
|
if (opts.mode == "year") {
|
|
|
if (opts.cellClick) opts.cellClick.call(me, datajson,e,me)
|
|
|
}
|
|
@@ -182,6 +191,7 @@ Calendar.prototype = {
|
|
|
if (beforeDate != afterDate) {
|
|
|
opts.newDate.setDate(opts.newDate.getDate() - 1);
|
|
|
}
|
|
|
+ opts.mode == "month" ? me._refreshCalendar(opts.newDate,cycleData) : me._refreshYearCalendar(opts.newDate);
|
|
|
$(parent).find(".calendar-month-text").text(monthText);
|
|
|
|
|
|
})
|
|
@@ -842,30 +852,17 @@ Calendar.prototype = {
|
|
|
}
|
|
|
$.fn.calendar = function (options) {
|
|
|
|
|
|
- var isSTR = typeof options == "string",
|
|
|
- args, ret;
|
|
|
-
|
|
|
- if (isSTR) {
|
|
|
- args = $.makeArray(arguments)
|
|
|
- args.splice(0, 1);
|
|
|
- }
|
|
|
-
|
|
|
var name = "calendar",
|
|
|
type = Calendar;
|
|
|
|
|
|
- var jq = this.each(function () {
|
|
|
- var ui = $.data(this, name);
|
|
|
+ var ui = $.data(this, name);
|
|
|
|
|
|
- if (!ui) {
|
|
|
- ui = new type(this, options);
|
|
|
- $.data(this, name, ui);
|
|
|
- }
|
|
|
- if (isSTR) {
|
|
|
- ret = ui[options].apply(ui, args);
|
|
|
- }
|
|
|
- });
|
|
|
+ if (!ui) {
|
|
|
+ ui = new type(this, options);
|
|
|
+ $.data(this, name, ui);
|
|
|
+ }
|
|
|
|
|
|
- return isSTR ? ret : jq;
|
|
|
+ return ui;
|
|
|
};
|
|
|
(function(w) {
|
|
|
/**
|