Browse Source

Merge pull request #754 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '8228fa3ff44ef1d44ef64ba6afc3645187d457d5':
  BI-34248 calendar的排版根据周首的配置决定
es6
windy 6 years ago
parent
commit
c100207d26
  1. 21
      dist/bundle.ie.js
  2. 40
      dist/bundle.ie.min.js
  3. 21
      dist/bundle.js
  4. 10
      dist/bundle.min.js
  5. 21
      dist/case.js
  6. 21
      dist/fineui.ie.js
  7. 40
      dist/fineui.ie.min.js
  8. 21
      dist/fineui.js
  9. 10
      dist/fineui.min.js
  10. 21
      dist/fineui_without_jquery_polyfill.js
  11. 2
      dist/utils.min.js
  12. 21
      src/case/calendar/calendar.js

21
dist/bundle.ie.js vendored

@ -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();

40
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

21
dist/bundle.js vendored

@ -50492,23 +50492,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 {
@ -50529,7 +50532,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,
@ -50596,6 +50599,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();

10
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

21
dist/case.js vendored

@ -1677,23 +1677,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 {
@ -1714,7 +1717,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,
@ -1781,6 +1784,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();

21
dist/fineui.ie.js vendored

@ -50330,23 +50330,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 {
@ -50367,7 +50370,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,
@ -50434,6 +50437,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();

40
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

21
dist/fineui.js vendored

@ -50734,23 +50734,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 {
@ -50771,7 +50774,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,
@ -50838,6 +50841,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();

10
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

21
dist/fineui_without_jquery_polyfill.js vendored

@ -35423,23 +35423,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 {
@ -35460,7 +35463,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,
@ -35527,6 +35530,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();

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

21
src/case/calendar/calendar.js

@ -37,23 +37,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 {
@ -74,7 +77,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,
@ -141,6 +144,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();

Loading…
Cancel
Save