diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-06-27 23:55:06 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-06-27 23:55:06 +0300 |
commit | 72d0db7a5919caf4c1c18a4bc1a6f22c372c2835 (patch) | |
tree | 5aaa4d76c8e454d30cf3d5862a689ebfce62d1da /models/boards.js | |
parent | ed0ef5b7d348df3fd1671ac44bfc8be41a296514 (diff) | |
parent | 0394a78ecea21c0174dd0b6f1d9d31947fa3b48e (diff) | |
download | wekan-72d0db7a5919caf4c1c18a4bc1a6f22c372c2835.tar.gz wekan-72d0db7a5919caf4c1c18a4bc1a6f22c372c2835.tar.bz2 wekan-72d0db7a5919caf4c1c18a4bc1a6f22c372c2835.zip |
Merge branch 'calendar' of https://github.com/TNick/wekan into TNick-calendar
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({ |