summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-04-28 20:50:55 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-04-28 20:56:11 +0200
commit153d729544fb5bbfa5fa40d236303cbc01352334 (patch)
treed8a9bb4262152643875fe59d647e58337a3dab9a /models/users.js
parent3d5abd60ccf3e0884a0346ec4a559ff5aa484b51 (diff)
downloadwekan-153d729544fb5bbfa5fa40d236303cbc01352334.tar.gz
wekan-153d729544fb5bbfa5fa40d236303cbc01352334.tar.bz2
wekan-153d729544fb5bbfa5fa40d236303cbc01352334.zip
Fix getStartDayOfWeek function
In case profile.startDayOfWeek is 0 it's evaluated to false and 1 is returned. Let's fix this by differentiating between undefined and an actual value. Fixes: 9ae20a3f51e63c29f536e2f5b3e66a2c7d88c691
Diffstat (limited to 'models/users.js')
-rw-r--r--models/users.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/models/users.js b/models/users.js
index 2d84141c..a1bc5b0f 100644
--- a/models/users.js
+++ b/models/users.js
@@ -530,8 +530,11 @@ Users.helpers({
getStartDayOfWeek() {
const profile = this.profile || {};
- // default is 'Monday' (1)
- return profile.startDayOfWeek || 1;
+ if (typeof profile.startDayOfWeek === 'undefined') {
+ // default is 'Monday' (1)
+ return 1;
+ }
+ return profile.startDayOfWeek;
},
getTemplatesBoardId() {