mirror of
https://github.com/wekan/wekan.git
synced 2026-01-25 10:46:09 +01:00
Implement option to change the first day of week in user settings
Implements #2535.
This commit is contained in:
parent
3ac5dba243
commit
8e14459cff
7 changed files with 95 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue