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 | |
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')
-rw-r--r-- | models/boards.js | 27 | ||||
-rw-r--r-- | models/users.js | 5 |
2 files changed, 32 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({ diff --git a/models/users.js b/models/users.js index 0093f7cb..5a7fbbe5 100644 --- a/models/users.js +++ b/models/users.js @@ -100,6 +100,11 @@ Users.attachSchema(new SimpleSchema({ 'profile.boardView': { type: String, optional: true, + allowedValues: [ + 'board-view-lists', + 'board-view-swimlanes', + 'board-view-cal', + ], }, services: { type: Object, |