Browse Source

BI-34455 周数标准替换

es6
windy 6 years ago
parent
commit
49b06237a0
  1. 43
      dist/bundle.ie.js
  2. 14
      dist/bundle.ie.min.js
  3. 43
      dist/bundle.js
  4. 14
      dist/bundle.min.js
  5. 43
      dist/core.js
  6. 43
      dist/fineui.ie.js
  7. 14
      dist/fineui.ie.min.js
  8. 43
      dist/fineui.js
  9. 14
      dist/fineui.min.js
  10. 43
      dist/fineui_without_jquery_polyfill.js
  11. 43
      dist/utils.js
  12. 6
      dist/utils.min.js
  13. 43
      src/core/func/date.js

43
dist/bundle.ie.js vendored

@ -17835,21 +17835,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -17998,7 +17993,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

14
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

43
dist/bundle.js vendored

@ -17835,21 +17835,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -17998,7 +17993,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

14
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

43
dist/core.js vendored

@ -17835,21 +17835,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -17998,7 +17993,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

43
dist/fineui.ie.js vendored

@ -18077,21 +18077,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -18240,7 +18235,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

14
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

43
dist/fineui.js vendored

@ -18077,21 +18077,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -18240,7 +18235,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

14
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

43
dist/fineui_without_jquery_polyfill.js vendored

@ -17581,21 +17581,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -17744,7 +17739,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

43
dist/utils.js vendored

@ -10595,21 +10595,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -10758,7 +10753,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

6
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

43
src/core/func/date.js

@ -49,21 +49,16 @@ _.extend(BI, {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay(); var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7; var startOfWeek = BI.StartOfWeek % 7;
if (date.getMonth() === 0) { var middleDay = (startOfWeek + 3) % 7;
var formatWeek = (week + 8 - startOfWeek) % 7; middleDay = middleDay || 7;
if(date.getDate() <= (formatWeek === 0 ? 7 : formatWeek)) { // 偏移到周周首之前需要多少天
return 1; var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
} var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
} d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
d.setDate(date.getDate() - (week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek))); var ms = d.valueOf();
var ms = d.valueOf(); // GMT
d.setMonth(0); d.setMonth(0);
d.setDate(1); d.setDate(1);
var offset = Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1; return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
if (d.getDay() !== startOfWeek) {
offset++;
}
return offset;
}, },
getQuarter: function (date) { getQuarter: function (date) {
@ -212,7 +207,27 @@ _.extend(BI, {
return s[par] || par; return s[par] || par;
}); });
} }
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
var a = str.match(re); var a = str.match(re);
for (var i = 0; i < a.length; i++) { for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]]; var tmp = s[a[i]];

Loading…
Cancel
Save