summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/boards.js27
-rw-r--r--models/users.js5
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,