diff options
Diffstat (limited to 'models/boards.js')
-rw-r--r-- | models/boards.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js index 911d82a1..3b6c280b 100644 --- a/models/boards.js +++ b/models/boards.js @@ -284,6 +284,33 @@ Boards.helpers({ return Cards.find(query, projection); }, + + cardsInInterval(start, end) { + return Cards.find({ + $or: [ + { + startAt: { + $lte: start, + }, endAt: { + $gte: start, + }, + }, { + startAt: { + $lte: end, + }, endAt: { + $gte: end, + }, + }, { + startAt: { + $gte: start, + }, endAt: { + $lte: end, + }, + }, + ], + }); + }, + }); Boards.mutations({ |