@pisell/pisellos 2.0.46 → 2.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -140,7 +140,11 @@ var getDaysByRepeatWeek = function getDaysByRepeatWeek(params, isGetRange) {
140
140
  for (var i = 0; i < frequency_date.length; i++) {
141
141
  var item = frequency_date[i];
142
142
  var _start = startTmp.day(item);
143
+ // 如果周结束的那一天还超过了deadline,则需要把_end置为deadline
143
144
  var _end = _start.add(scheduleDiff, 'second');
145
+ if (_end.isAfter(deadline, 'day')) {
146
+ _end = deadline;
147
+ }
144
148
  if (isGetRange) {
145
149
  if (excludedDaysMap.has(_start.format('YYYY-MM-DD'))) {
146
150
  startTmp = startTmp.day(1).add(frequency, 'day');
@@ -140,7 +140,10 @@ var getDaysByRepeatWeek = (params, isGetRange) => {
140
140
  for (let i = 0; i < frequency_date.length; i++) {
141
141
  const item = frequency_date[i];
142
142
  const _start = startTmp.day(item);
143
- const _end = _start.add(scheduleDiff, "second");
143
+ let _end = _start.add(scheduleDiff, "second");
144
+ if (_end.isAfter(deadline, "day")) {
145
+ _end = deadline;
146
+ }
144
147
  if (isGetRange) {
145
148
  if (excludedDaysMap.has(_start.format("YYYY-MM-DD"))) {
146
149
  startTmp = startTmp.day(1).add(frequency, "day");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.0.46",
4
+ "version": "2.0.47",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",