|
|
@ -50088,23 +50088,26 @@ BI.Calendar = BI.inherit(BI.Widget, { |
|
|
|
// 是周几
|
|
|
|
// 是周几
|
|
|
|
log.FDay = De.getDay(); |
|
|
|
log.FDay = De.getDay(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 当前BI.StartOfWeek与周日对齐后的FDay是周几
|
|
|
|
|
|
|
|
var offSetFDay = (7 - BI.StartOfWeek + log.FDay) % 7; |
|
|
|
|
|
|
|
|
|
|
|
// 当前月页第一天是几号
|
|
|
|
// 当前月页第一天是几号
|
|
|
|
log.PDay = MD[M === 0 ? 11 : M - 1] - log.FDay + 1; |
|
|
|
log.PDay = MD[M === 0 ? 11 : M - 1] - offSetFDay + 1; |
|
|
|
log.NDay = 1; |
|
|
|
log.NDay = 1; |
|
|
|
|
|
|
|
|
|
|
|
var items = []; |
|
|
|
var items = []; |
|
|
|
BI.each(BI.range(42), function (i) { |
|
|
|
BI.each(BI.range(42), function (i) { |
|
|
|
var td = {}, YY = log.ymd[0], MM = log.ymd[1] + 1, DD; |
|
|
|
var td = {}, YY = log.ymd[0], MM = log.ymd[1] + 1, DD; |
|
|
|
// 上个月的日期
|
|
|
|
// 上个月的日期
|
|
|
|
if (i < log.FDay) { |
|
|
|
if (i < offSetFDay) { |
|
|
|
td.lastMonth = true; |
|
|
|
td.lastMonth = true; |
|
|
|
DD = i + log.PDay; |
|
|
|
DD = i + log.PDay; |
|
|
|
// 上一年
|
|
|
|
// 上一年
|
|
|
|
MM === 1 && (YY -= 1); |
|
|
|
MM === 1 && (YY -= 1); |
|
|
|
MM = MM === 1 ? 12 : MM - 1; |
|
|
|
MM = MM === 1 ? 12 : MM - 1; |
|
|
|
} else if (i >= log.FDay && i < log.FDay + MD[log.ymd[1]]) { |
|
|
|
} else if (i >= offSetFDay && i < offSetFDay + MD[log.ymd[1]]) { |
|
|
|
DD = i - log.FDay + 1; |
|
|
|
DD = i - offSetFDay + 1; |
|
|
|
if (i - log.FDay + 1 === log.ymd[2]) { |
|
|
|
if (i - offSetFDay + 1 === log.ymd[2]) { |
|
|
|
td.currentDay = true; |
|
|
|
td.currentDay = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -50125,7 +50128,7 @@ BI.Calendar = BI.inherit(BI.Widget, { |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
BI.Calendar.superclass._init.apply(this, arguments); |
|
|
|
BI.Calendar.superclass._init.apply(this, arguments); |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var items = BI.map(BI.Date._SDN.slice(0, 7), function (i, value) { |
|
|
|
var items = BI.map(this._getWeekLabel(), function (i, value) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
type: "bi.label", |
|
|
|
type: "bi.label", |
|
|
|
height: 24, |
|
|
|
height: 24, |
|
|
@ -50192,6 +50195,12 @@ BI.Calendar = BI.inherit(BI.Widget, { |
|
|
|
})))); |
|
|
|
})))); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_getWeekLabel: function () { |
|
|
|
|
|
|
|
return BI.map(BI.range(0, 7), function (idx, v) { |
|
|
|
|
|
|
|
return BI.Date._SDN[(v + BI.StartOfWeek) % 7]; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isFrontDate: function () { |
|
|
|
isFrontDate: function () { |
|
|
|
var o = this.options, c = this._const; |
|
|
|
var o = this.options, c = this._const; |
|
|
|
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay(); |
|
|
|
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay(); |
|
|
|