diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-04-22 20:36:28 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-04-22 20:36:28 +0300 |
commit | e7603298d7a67c928bb20d26d57268b2c0b715d3 (patch) | |
tree | c25c0eeb010635a9771754a067ab9c0f0d1c8997 /models | |
parent | 9969c89b1cca16be58caf20444c9fcf0e6372eec (diff) | |
parent | 8e14459cff4da1391f536dfbc6441abb21e9c215 (diff) | |
download | wekan-e7603298d7a67c928bb20d26d57268b2c0b715d3.tar.gz wekan-e7603298d7a67c928bb20d26d57268b2c0b715d3.tar.bz2 wekan-e7603298d7a67c928bb20d26d57268b2c0b715d3.zip |
Merge branch 'marc1006-week_start'
Diffstat (limited to 'models')
-rw-r--r-- | models/users.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js index f4b7329a..f4f4f38e 100644 --- a/models/users.js +++ b/models/users.js @@ -190,6 +190,13 @@ Users.attachSchema( type: Number, optional: true, }, + 'profile.startDayOfWeek': { + /** + * startDayOfWeek field of the user + */ + type: Number, + optional: true, + }, 'profile.starredBoards': { /** * list of starred board IDs @@ -521,6 +528,11 @@ Users.helpers({ return profile.language || 'en'; }, + getStartDayOfWeek() { + const profile = this.profile || {}; + return profile.startDayOfWeek || 1; + }, + getTemplatesBoardId() { return (this.profile || {}).templatesBoardId; }, @@ -652,6 +664,10 @@ Users.mutations({ return { $set: { 'profile.showCardsCountAt': limit } }; }, + setStartDayOfWeek(startDay) { + return { $set: { 'profile.startDayOfWeek': startDay } }; + }, + setBoardView(view) { return { $set: { @@ -682,6 +698,10 @@ Meteor.methods({ check(limit, Number); Meteor.user().setShowCardsCountAt(limit); }, + changeStartDayOfWeek(startDay) { + check(startDay, Number); + Meteor.user().setStartDayOfWeek(startDay); + }, }); if (Meteor.isServer) { |