aboutsummaryrefslogtreecommitdiffstats
path: root/npm_assets/node_modules/luxon/src/interval.js
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-04-20 00:12:09 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-04-20 00:12:09 -0400
commit942e313727d1ad886a1024c24fe4a9e8e2e0bb3e (patch)
tree1c4d5d826655cdb812c88563a25410f8b54e41d2 /npm_assets/node_modules/luxon/src/interval.js
parent8eeed31eb2f86ac982fa4b26f93b15828289c56d (diff)
New upstream version 8.2.0.upstream/8.2.0
Diffstat (limited to 'npm_assets/node_modules/luxon/src/interval.js')
-rw-r--r--npm_assets/node_modules/luxon/src/interval.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/npm_assets/node_modules/luxon/src/interval.js b/npm_assets/node_modules/luxon/src/interval.js
index f2cfce8..71273fd 100644
--- a/npm_assets/node_modules/luxon/src/interval.js
+++ b/npm_assets/node_modules/luxon/src/interval.js
@@ -340,15 +340,16 @@ export default class Interval {
}
let { s } = this,
- added,
+ idx = 1,
next;
const results = [];
while (s < this.e) {
- added = s.plus(dur);
+ const added = this.start.plus(dur.mapUnits(x => x * idx));
next = +added > +this.e ? this.e : added;
results.push(Interval.fromDateTimes(s, next));
s = next;
+ idx += 1;
}
return results;
@@ -428,7 +429,7 @@ export default class Interval {
const s = this.s > other.s ? this.s : other.s,
e = this.e < other.e ? this.e : other.e;
- if (s > e) {
+ if (s >= e) {
return null;
} else {
return Interval.fromDateTimes(s, e);